开发者

Change Fore Color in RegularExpression validation error message

开发者 https://www.devze.com 2023-04-13 06:46 出处:网络
How can I change the fore color of the error message programatically? RegularExpressionValidator errorExp = new RegularExpressionValidator();

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;
0

精彩评论

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