简体   繁体   中英

Change default ValidationSummary template in MVC4

I want to change default Html.ValidationSummary() template in order to make it work with twitter bootstrap. Where can I find it?

Only lead I found was this . But it does not help. I need to change the source itself since I'm using client-side validation. I've checked jquery.validate.js and jquery.validate.unobtrusive.js but no html code there.

so you either need to change it in CSS.

check this link

change line this way add in .alert-error and auto generated class .validation-summary-errors , also add related class.

.alert-error, .validation-summary-errors {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

so like this way to change css class.

auto generated css class in ValidationSummary .

.validation-summary-errors {
    background-color: #D9FFB2;
    border:1px solid #5CBA30;
    width: 400px;
    }
span.validation-summary-errors {
    border-bottom-color: #D9FFB2;
    display:block;
    }
ul.validation-summary-errors {
    margin:0;
    padding:0;
    border-top:none;
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM