Creating dynamic web forms in ASP.NET - dynamic

My project aims to provide the end user the ability to dynamically design forms in run-time. That would be something like a simple web based IDE to design web-forms.
The end user should be able enter all the components and their respective properties of the web form at runtime.
A web form should be generated based on the components and properties defined by the user and the final form should be displayed.
Is reflections the best ways to do this? If so could you please point me an appropriate page as to how I would have to do this?
Are there other ways to implement this apart from reflections?
I tried researching on web-parts but , I came to realize that web parts was not what I intended to do with the project because I would not know any of the properties of the components in advance during compile time.

Does it have to be webforms and its controls running from server ( from System.Web.UI )?
Just to share some experience, we have a huuge codegeneration like applications, which given parameters ( which could be input like ones or the whole database depending of the case ) can generate html submiting forms to server side using jquery and/or dojo ajax features...
because we want simplicity, we decided we would not generate server side controls dinamicaly
the bottom line is, I don't know your requirement, but maybe you want to do something similar.

Related

Razor Page with dynamic form

Having recently migrated from years of web forms, I’ve built numerous dot net core razor page apps - So I’m not a complete beginner but I am struggling to understand the best way to approach one particular scenario. I have a page that captures some header information but also needs to capture some additional data that is specific to the “type” of record being edited. In webforms I dynamically loaded a user control for the relevant type using a path name (the path name of the user control being linked to the type so the system knew what form to load). With user controls I could then handle the form submission which meant the logic could be completely different for each type/form. Whereas I can use view components to create the relevant UI in the same way in my razor pages app, I can’t then handle the post back from there. So what would be the best way to approach this in razor pages? To make matters more complex, the type (and thus the objet i want to capture) could be defined in a RCL (another project). Also the type needs to be defined in a database entry, so I need to be able to load it from a string. Whereas a standalone page for each type would be easy, the management of this data is on one place in the core system so I can’t have a different page for each one.

Use Piranha CMS Manager editor in application for other users

I am trying to create some dynamic forms using Piranha CMS. As far as I managed to learn it is not supported right now, so I'm looking for work arounds or alternatives.
What I want to do now is use the editor from the manager for other users. To be more precise: this is how the editor looks like inside my manager when I want to edit a page
I have a text input and a select, both are Fields and there are many more fields to be used.
I want the sys admin to create a page with a list of inputs like this, which right now are usable only by the admin. BUT make this list of inputs available for edit to other users as well. Is it possible?
I'm not sure how to extract this editor or behavior or even if it is possible. The problem is we really need the admin to be able to configure different form inputs for users as it is the main core of our functionality.
Any help/advice is highly appreciated, thank you!
The components in the management UI is not designed to be reused in the front-end application in any way. The edit models in the manager contains a lot of extra meta data since the UI is completely generic. If you want to build an edit UI in your front end application, and you're using MVC or Razor Pages, the simplest way is to.
Get the generic model instead of your strongly typed model, for example api.Pages.GetById(...) instead of api.Pages.GetById<T>(...).
Loop the available fields in your selected region (a region is an ExpandObject which can be casted to an IDictionary<string, object>).
Use the built in support in Razor by calling #Html.EditorFor(...) for the fields.
Using this approach you can easily create your own EditorTemplates for the different types of fields you use that will match the rendering in your client application.
Best regards
Håkan

how to handle dynamic objects\controls with OpKey Personal edition

Any idea how to handle dynamic objects and controls from within OpKey Personal. We are using OpKey an automation framework over selenium since past one year but got into a problem lately.
My situation. a control in my web portal is displayed dynamically bsed on certain input parameters i choose. Using regular expression in OpKey object repository is not working.
Any idea how can i handle this situation

Should a dynamic help page content be stored in Database or HTML file?

So, I'm trying to come up with a better way to do a dynamic help module that displays a distinct help page for each page of a website. Currently there is a help.aspx that has a title and div section that is filled by methods that grab a database record. Each DB record is stored html withy the specific help content. Now, this works but it is an utter pain to maintain when, say an image, changes or the text has to be edited, you have to find and updated 1 or more DB records. I was thinking instead, I could build a single html page that basically shows/hides panels and inside each panel is the appropriate help content. As long as you follow a proper naming convention (name the panels ID to the page/content it represents) using ctrl + f will get you where you need to go and make it easier to find the content you need. What I'm curious of is would this have an impact on performance? The html page would be a fairly large file and would be hosted/ran at the server but it would also remove the need for Database calls. Would the work even be worth the benefit here or am I reinventing the wheel already in place?
Dynamic anything should be stored in the database. A truly usable web application should NEVER need code modified to change content. Hiding content is usually not a good idea, imagine if you expanded your application to 100 different pages that need their own help page. Then when someone clicks help their browser has to load 99 hidden pages to get 1 that it will show. You need to break your help page down into sections and just store the plain text in the database. I would need to know more about what language you're using as well as the architecture you're using to elaborate further but take a look below.
The need your describing is pretty much what MVC (web application architecture type) was built for.
If you're already using ASP.net and you aren't too far into your project I would consider switching to MVC. It's an architecture built specifically with dynamic page content in mind. You build different 'Views' (the V in MVC) that will dynamically build the HTML based on the content it receives from the Controller (The C in MVC) which pulls it's data from the database/Model (The M) and modifies it for the View. Also once you get into MVC you can couple it with Razor and half of your code get's written for you. It's a wonderful thing.
http://www.asp.net/mvc

Umbraco 5 newb: Content from custom Table

I am currently investigating the possibilities of different CMSs for a company-site.
Done quite a few projects in classical ASP, ASP.NET, Joomla etc..
I would like to use Umbraco 5 for the first time.
For that project we have a SQL-Table with Job-Opportunities:
like: JobName, Department, Description, etc..
These should be listed on a page. In ASP.NET I would use something like a Repeater, etc.. with PageSize option and automatic paging.
In the Backend (Backoffice in Umbraco, I assume) there has to be an Insert/Edit/Delete Page with the corresponding input boxes, which are maintained by the company employees, not by web-developers.
Which route should I look at? I am completely stuck, is there an example anywhere?
Can I use my own data-tables, or could/should I use the Umbraco content tables for this?
Thank you,
Reinhard
Welcome to Umbraco.
If you choose to use a pre-existing database, you're going to need the following pieces:
an ORM to access read/write the data
a custom hive provider for that data to allow for Umbrace to read it as an entity
a custom tree to allow for editing and adding data in the backoffice
a macro to display the content on the frontend.
http://web-matters.blogspot.com/2011/11/umbraco-5-hive-provider-tree-editor.html
is a great place to start.
As you're probably picking up on, this is a lot of work.. so, most importantly: Are you trying to maintain two applications?
If so, do you really need to be able to edit the list in both applications? Your task would be much simpler if you only allowed editing from the other application, and displayed the read-only list using web services.
If not, ditch the custom database. Umbraco 5 is a full EAV/CR system, so unlike some CMS products, you'll be able to represent any rdbs structure you can imagine. The simplest way would be to create a custom document type with those properties to represent a job opportunity, and store those job opportunities on a new node in the content tab.
About document types: http://our.umbraco.org/wiki/how-tos/working-with-document-types