Hey guys
Just wondering how and when people are using Editor/Display Templates vs. Html Helpers. Specifically I am talking about its use in rendering different UI control rather than rendering entities.
For instance, I have something like the following atm:
<tr>
<th><%= Html.LabelFor(x => x.ActivityTypeId) %></th>
<td><%= Html.EditorFor(x => x.ActivityTypeList, "MultiSelectDropDownList")%></td>
</tr>
<tr>
<th><%= Html.LabelFor(x => x.Name) %></th>
<td><%= Html.EditorFor(x => x.Name) %></td>
</tr>
<tr>
<th><%= Html.LabelFor(x => x.Description) %></th>
<td><%= Html.DisplayFor(x => x.Description, "DisplayString")%></td>
</tr>
But of late I am wondering if I should be doing this:
<tr>
<th><%= Html.LabelFor(x => x.ActivityTypeId) %></th>
<td><%= Html.MultiSelectDropDownList(x => x.ActivityTypeList)%></td>
</tr>
<tr>
<th><%= Html.LabelFor(x => x.Name) %></th>
<td><%= Html.EditorFor(x => x.Name) %></td>
</tr>
<tr>
<th><%= Html.LabelFor(x => x.Description) %></th>
<td><%= Html.DisplayString(x => x.Description)%></td>
</tr>
But if I go with this second option is there much point of using the middle editor for... I would be just a well off using Html.Textbox and have the benefit of being able to set any html property I like.
I'm interested what patterns people are using here... Any ideas?
Cheers Anthony