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
I encountered the same challenge and with some help for the labels (see below), here is what I got :
@Html.LabelFor(model => model.Name, new {@class = "control-label"})
@Html.EditorFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name, null, new {@class = "help-inline"})
Html.LabelFor
implementation : https://stackoverflow.com/a/6722082
I didn't try with the unobstrusive validation, but it seems you just have to activate it.
If you are looking for a global error, you should use something like :
@if (ViewData.ModelState.IsValid == false) {
}
There is a live example (in french) here : http://ws.sherbrow.fr/auth
The whole project source code should be available some time soon (see my profile - or ask me directly).