How to change the display name for LabelFor in razor in mvc3?
问题 In razor engine I have used LabelFor helper method to display the name But the display name is seems to be not good to display. so i need to change my display name how to do it.... @Html.LabelFor(model => model.SomekingStatus, new { @class = "control-label"}) 回答1: You could decorate your view model property with the [DisplayName] attribute and specify the text to be used: [DisplayName("foo bar")] public string SomekingStatus { get; set; } Or use another overload of the LabelFor helper which