ASP.Net Validator Default Style

asp.net, validation

Solution

You can do this in your css file:

.validator
{
    color: blue !important;
}

This will override the inline red style.

Problem

I'm using several variants of the Validator controls (RequiredFieldValidator, CompareValidator, etc) and am using the CssClass property of the validator. I can see (via Firebug) that the class is being applied, but the validator control itself is adding a style element to it, namely color: red. But I don't want that. I want the control to use the cssclass only. I know I can override the Forecolor attribute, but I'll have to do that on every validator in the project. And I'd really like to be able to just change my CSS Class in my stylesheet in case we have to change all the error message appearances in the future. Anyone have any clues how to tell the Validator controls to NOT use their default styles?

Original source