Change Fore Color in RegularExpression validation error message
How can I change the fore color of the error message programatically?
RegularExpressionValidator errorExp = new RegularExpressionValidator();
Err开发者_开发问答orExp.ErrorMessage = "You entered invalid data"; (Force it to be blue?)
Thank you
There is a ForeColor
property, according to the documentation, which just sets an inline style, but I would recommend setting a value for CssClass
and specifying your desired color in a style sheet.
errorExp.ForeColor = Color.Blue;
精彩评论