Apply Twitter Bootstrap Validation Style and Message to ASP.NET MVC validation

前端 未结 12 1626
星月不相逢
星月不相逢 2021-01-30 00:57

How can I integrate ASP.NET MVC unobtrusive validation and Twitter Bootstrap? I want to have all those validation messages and styles appropria

12条回答
  •  迷失自我
    2021-01-30 01:45

    On Bootstrap 3 you have to add:

    .validation-summary-errors
    {
        .alert();
        .alert-danger();
    }
    .field-validation-error 
    {
        .label();
        .label-danger();
    }
    

    you'll see something like that:

    Validation errors demo

提交回复
热议问题