Integrating Twitter Bootstrap with Asp.net MVC 3 forms

后端 未结 6 1730
有刺的猬
有刺的猬 2021-01-31 09:59

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

6条回答
  •  心在旅途
    2021-01-31 10:30

    You can integrate MVC3 validation with Bootstrap framework by adding the following javascript to your page (View)

    
    

    Besides, on the Views (for example "Create.cshtml") make sure that the fields in the form are formatted as the following...

        
    @Html.LabelFor(Function(model) model.Name)
    @Html.EditorFor(Function(model) model.Name) @Html.ValidationMessageFor(Function(model) model.Name)

提交回复
热议问题