I have a list of Key/Value pairs. basically its a List where ViewModel is a custom class of the form
public class ViewModel
{
public String Key { get; set; }
public String Value { get; set; }
}
In the View i would need to render Label and Textbox for Key and Value respectively.Im trying to use Html.DisplayFor() however it goes with model and only displays the properties of the model and not the list.
I would like to achieve something of the format
<% foreach (var item in Model) { %>
<tr>
<td>
<%:Html.Display("item")%>
</td>
<td>
<%:Html.Display("item.Value")%>
</td>
</tr>
<% } %>