Validator color and css-stylesheets - a solution

H

Hans Kesting

For those interested:

I solved a problem I had using a cssclass with validators. The textcolor
of the errormessage didn't want to follow the css.

Two solutions:
* when the validator is defined in the aspx/ascx, use a ForeColor=" "
attribute.
* when programmatically adding a validator, I couldn't set the
ForeColor property to some "ignore" value ("Transparent" or
FromArgb(0,0,0,0) did not work). Finally I solved this by adding
the "!important" specifier in the css-file ("color: red !important;")

The basic problem is that the Forecolor attribute of the validator
generates a "style" attribute in html. This is specified "closer"
to the html-element than some css-setting, so overrides this.

If anyone has a better solution for the second case (or the first),
feel free to reply!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top