Specifying CSS classes and html attributes with MVC helpers


Ok you’ve finally got you MVC controller and models all wired up, you BL is fine, now you want to pretty up those views, so you’ll start to use some css and javascript.

Here’s how you can specify html attributes with your html helpers.

Button sample:



Form sample:


Note @ is used to escape the c# keyword class.


Comments are closed