Solo me pregunto cómo y cuándo las personas están usando Editor/Display Templates versus Html Helpers. Específicamente, estoy hablando de su uso en la representación de diferentes controles de IU en lugar de entidades de renderizado.¿Cómo se usan las plantillas de Editor/Display frente a Html Helpers?
Por ejemplo, tengo algo como lo siguiente 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>
Pero en los últimos tiempos me pregunto si yo debería estar haciendo esto:
<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>
Pero si voy con esta segunda opción ¿De qué sirve usar el editor intermedio para ...? Sería muy bueno usar Html.Textbox y tener la ventaja de poder establecer cualquier propiedad html que me guste.
Me interesan los patrones que las personas usan aquí ... ¿Alguna idea?
Saludos Anthony