views:

14

answers:

1

Hello,

With ASP.NET MVC 1.0, we could write something like:

<label for = "FirstName">First Name:</label>

Which displays "First Name:" on screen. Now, with ASP.NET MVC 2.0, we have

<% = Html.LabelFor(model => model>FirstName)%>

Which displays "FirstName" on the screen. It looks to me a little odd to display things like FirstName, LastName, ... (instead of First Name:, Last Name:, ...). Is there anyway, to get a more explicit text with Html.LabelFor()???

Thanks for helping

+2  A: 

You can use this in your model:

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

and you'll need this:

using System.ComponentModel;
RedFilter