Dynamically generate a form?
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".
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.
精彩评论