Generate a form from an untyped mvc 2 model or dictionary
HI all,
I am looking for a way to generate and validate mvc 2 forms using untyped entities. Basically similar how the propertygrid in winforms behaves.
In the utmost basic sample for instance have an dictionary and开发者_Python百科 generate a form from that depending on the datatype in the Dictionary ofcourse it should be able to fill the same dictionary in the controller.
Any ideas or leads or hints?
Best regards, Emile
You can use the Html.EditorForModel helper method and customize its appearance using templates.
A great series about that can be found on Brad Wiloson's blog: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-1-introduction.html
精彩评论