Official “How to” for MVC Editor/Display Templates?

一世执手 提交于 2019-11-29 09:32:09

Official documentation? Don't know any off hand, but I know there are a ton of examples. In particular, I like Phil Haack's discussion on model binding to lists. It includes an example for an editor template in a pretty complicated example. There's source code there, too.

Since he's co-authored every MVC Wrox book, I consider him a pretty definitive source:

http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

Here's another blog post (non-official) in a similar vein:

http://blogs.msdn.com/b/stuartleeks/archive/2010/03/30/collections-and-asp-net-mvc-templated-helpers-displayfor-editorfor.aspx

best article that I have found for it is:

http://www.growingwiththeweb.com/2012/12/aspnet-mvc-display-and-editor-templates.html

It explains how to create DisplayFor and EditorFor templates really well.

ASP.NET MVC have a lot of materials on http://www.asp.net/mvc with different examples. EditorTemplates and DisplayTemplates is spetial folders for models (like here Quick Tips About ASP.NET MVC – Editor Templates) and you asking about html helpers, not templates.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!