Generate a form dynamically?

I have about 10 different objects that are populated from user input. Instead of creating 10 different view pages, is there a way to dynamically generate an input form and only have one view page? What I am looking for is a runtime solution like a form generator in visual studio when you "Add View".

+2


a source to share


1 answer


<%=Html.EditorForModel() %>

will use reflection to create form fields for all properties of the object. You can just use the base class (object) as a model and pass your object from the controller.



+2


a source







All Articles