views:

10

answers:

0

Hello,

Let's say, I've the following class definition:

public class Person
{
  [DisplayName("First Name")]
  public string FirstName { get; set; }
  [DisplayName("Last Name")]
  public string LastName { get; set; }
}

And, I'd like to use LabelFor(x =>x.FirstName), and so on. Unfortunately, the page inherits from

IEnumerable<T>

so there's no way to use lambda expression. Is there any workarround? Or, I do have to use the Label(String) version?

Thanks for helping