Pitfall of using Alternate Template Name in @Html.EditorFor

Edit
Lately I am digging deeper and deeper into .Net MVC specific coding style. For some reason I need to use

@Html.EditorFor(model => model.property, "AlternateTemplateName")
And my property is a List. I was expecting the @Html.EditorFor method will loop through the List as when I am calling

@Html.EditorFor(model => model.property)
But What I found out is that, when supplying the AlternateTemplateName, I have to handle the looping myself. It tried also the "UIHint" way to bind a EditorTemplate with the Property but I still need to handle the looping myself. It is those time I asked why the engineer in Microsoft will create 2 behaviors for such a similar method !!!



EditorFor and EditorForModel | The ASP.NET Forums
Pitfall of using Alternate Template Name in @Html.EditorFor Pitfall of using Alternate Template Name in @Html.EditorFor Reviewed by DF on 1:16:00 AM Rating: 5
©DF. Powered by Blogger.