Trying to add a 'class' html attribute, but I think the keyword 'class' is causing issues.
<%: Html.TextBox("name", "value", new {class: " required "})%>
Is there a workaround?
Just prefix 'class' with an '@' as it's a reserved keyword.
<%: Html.TextBox("name", "value", new { @class: " required "})%>
If you need some background on the @ keyword, this is a good SO question to read.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With