开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜