How can I use placeholder attribute with Html.EditorFor?

后端 未结 5 1273
迷失自我
迷失自我 2021-02-06 22:14

I want to use the placeholder attribute in the Html.EditorFor so I did just like in the first answer: Html5 Placeholders with .NET MVC 3 Razor EditorFor extension?

But i

5条回答
  •  情深已故
    2021-02-06 22:35

     @Html.EditorFor(model => model.members_ssn, new { htmlAttributes = new { @class = "form-control", placeholder = "Your Example Here" } })
    

提交回复
热议问题