I would like to pass the html input class attribute in ASP.NET MVC for my input box using Html.TextBox(‘FullName’, null, new{class=’grey-input’}). But I think I can use the ‘class‘ keyword.
How can I bypass this issue?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
yeh you need to use @class which allows you to use a reserved word.
So an example:
Produces
You could also create a custom Extension method for this also, but the above way is what I use.