I am using Asp.net MVC 3 and Twitter Bootstrap. What I want is to integrate both of them. The big problem for me is forms. I am using the HtmlHelper
and it is a pro
A bit late answer, but I'll propose a better solution and you should totally accept my answer ;)
Use TwitterBootstrapMVC.
With a single line of code it will generate exactly the html you need:
@Html.Bootstrap().ControlGroup().TextBoxFor(x => x.Field)
For Global error all you need to write is:
@Html.Bootstrap().ValidationSummary()
... it will generate an alert div with all errors listed in it. Notice that for client side validation it needs some JavaScript for things to be styled properly.
On top of that it will take care of all the unobtrusive validation tags for you. It also offers fluent syntax, that enables full customization of the inputs/labels...
Check it out!
Disclaimer: I'm the author of TwitterBootstrapMVC As of Bootstrap 3 (and TwitterBootstrapMVC 3) TwitterBootstrapMVC requires a licence for usage.