Extend MVC3 razor Html.LabelFor to add css class

后端 未结 2 1596
旧时难觅i
旧时难觅i 2021-02-13 10:47

I am trying to add a css class to Html.LabelFor on an EditorTemplate

 @Html.LabelFor(model => model.Name, new { @class = \"myLabel\" })

my

2条回答
  •  抹茶落季
    2021-02-13 11:26

    You're using html.LabelHelper

    However you have defined your own LabelHelper method, so use it =)

提交回复
热议问题