| Scenario |
Model Property |
Method Call |
Result |
|
Using Property Name as the resource key.
|
[Required]
public string FirstName { get; set; }
|
Html.LabelFor(m => m.FirstName) |
|
| Specifying Resource Key only |
[Display(Name = "LastNameLabel")]
public string LastName { get; set; }
|
Html.LabelFor(m => m.LastName) |
|
| Fully conventional, loading value from resource file |
public int HitPoints { get; set; }
|
Html.LabelFor(m => m.HitPoints) |
|
| Fully conventional, no corresponding resource string, pascal case splitting. |
public int ArmorClass { get; set; }
|
Html.LabelFor(m => m.ArmorClass) |
|
| Using Name as display text fallback |
[Display(Name = "The Level (from DisplayAttribute)")]
public int Level { get; set; }
|
Html.LabelFor(m => m.Level) |
|