Author: Scott Hanselman - ASP.NET | Posted on: 9/10/2012 9:12:54 PM | Views : 1009

Did you enjoy my recent post on ASP.NET MVC DisplayTemplate and EditorTemplates for Entity Framework DbGeography Spatial Types and it's associated GIANT URL? Modeling Binding and EditorTemplates...for ASP.NET Web Forms? DisplayTemplates and EditorTemplates are a great way in ASP.NET MVC to keep things DRY (Don't Repeat Yourself.) That means I can just write EditorFor() calls like this: @Html.EditorFor(model => model.Location) See how I didn't say "TextBoxFor" or "MapFor"? You say EditorFor and it makes the right choice. If the type is called DbGeography then it will look for a Editor Template at ~/Shared/EditorTemplates/DbGeography.cshtml. It's a nice feature of ASP.NET MVC that folks don't use enough...(read more)Go to the complete details ...