I think I'm missing something relatively simple here, but I'm trying to find a way of applying a CSS class to my controls within my views. I'm using the
<%= Html.SubmitButton("Submit", "Edit Plot")%>
style method of doing this. Short of putting divs around these elements and applying the styling, is there anyone way of getting access to the CssClass
property that would be available in normal .NET?
Check out http://blog.veggerby.dk/2008/11/19/aspnet-mvc-htmlhelper-methods-and-css-class/, it is simply:
<% = Html.TextBox("name", null, new{ @class = "required"}) %>
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