I have a view with a strongly-typed model associated with it
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
Inherits="System.Web.Mvc.ViewPage<SomeNamespace.SomeViewModel>" %>
The SomeViewModel looks like this
class SomeViewModel
{
public IEnumerable<Foo> Foos {get; set;}
}
and say Foo is
class Foo
{
public string Bar {get; set;}
}
and in the view
<% foreach (var item in Model.Foos) { %>
<tr>
<td>
<%= Html.LabelFor(f => f.Bar) %>
</td>
I'm not sure how to display Bar
property in item
using Html.LabelFor()
Can someone help me with this?
Thanks,