I am working on an asp.net mvc-5 web application , and i wrote the following :-
@Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
&
@Html.EditorFor(model => model.Name, new { @class = "form-control" })
but this will not have any effect on the generated html, but if i changed the EditorFor
to be TextboxFor
i will get the effect for the form-control class ? can anyone advice on this please ? i read that this is supported only inside asp.net mvc 5.1 ? so what are the available approaches i can follow to get this working other than upgrading my asp.net mvc-5 to asp.net mvc 5.1 , to eliminate the risk of upgrading?
Can anyone adivce ?