Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic (Runtime Generated) Forms in ASP.NET MVC [closed]

Tags:

This is a general design question: How would you implement a dynamic (runtime generated) form in ASP.NET MVC?

Here's the situation:

  1. A site admin can define form parameters (fields, type of fields, validation) with a GUI (MVC view).
  2. As needed, the runtime generates the form for the end user based on the admin configuration. I'm assuming that all of this logic would reside in the controller - or perhaps extension methods, action filters or something like that.
  3. End user fills out the form, hits submit, information is captured in database.

The customization does not need to support nested controls, 3rd party controls and so forth, but I suspect a very elegant design would allow for that. Mostly, I just need the admin to be able to specify additional fields as textboxes, checkboxes, radio buttons and comboboxes. I will also need the application to allocate a space for this data to be saved in the db, but I believe I have that part figured out.

Thanks for the help.

like image 1000
Robert Claypool Avatar asked May 29 '09 16:05

Robert Claypool


1 Answers

I had the same need in a recent project. I created a class library for this. I just released a new version of the library.

Maybe it can help you: ASP.NET MVC Dynamic Forms

like image 125
Ronnie Overby Avatar answered Oct 14 '22 04:10

Ronnie Overby