开发者

Styling ASP.NET MVC validation errors?

开发者 https://www.devze.com 2023-03-06 07:49 出处:网络
Can ASP.NET MVC\'s validation errors 开发者_运维问答be styled? Where? I tried editing .input-validation-error class in Site.css but that didn\'t have any effect.

Can ASP.NET MVC's validation errors 开发者_运维问答be styled? Where? I tried editing .input-validation-error class in Site.css but that didn't have any effect.

pom


If you style up .field-validation-error then this will change the validation error text messages.

.field-validation-error{ color: red; font-weight: bold; }

If you style up .input-validation-error then this will change the input style when there is a validation error.

.input-validation-error{ background: pink; border: 1px solid red; }


It sounds like what you are doing is correct, but the css gets cached which means you won't necessarilly see the changes you make.

Once you have edited the css file, press Ctrl + F5 from your browser to reload css.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号