How do I add the css class attribute to a textbox in razor?
-
25-09-2019 - |
문제
I have tried:
@Html.TextBoxFor(m => m.UserName, new {@class='textbox'})
which isn't working.
해결책
@Html.TextBoxFor(m => m.UserName, new {@class="textbox"})
A c# string literal does not take single quotes.
'textbox' -> "textbox"
제휴하지 않습니다 StackOverflow