Reputation: 1912
I have about 10 different objects that get populated from user input. Instead of creating 10 different view pages, is there a way to dynamically generate the input form and have only one view page? What I am looking for is a run-time solution like the form generator in visual studio when you "Add View".
Upvotes: 2
Views: 199
Reputation: 13775
The <%=Html.EditorForModel() %>
will use reflection to generate form fields for all the properties on an object. You can just use a base class(object) as your model and pass your object in from the controller.
Upvotes: 2