on the page_prerender event paste below scratched code
foreach (BaseValidator valControl in Page.Validators)
{
WebControl assControl = (WebControl)Page.FindControl(valControl.ControlToValidate);
if (!valControl.IsValid)
assControl.BackColor = System.Drawing.Color.Yellow;
else
assControl.BackColor = System.Drawing.Color.White;
}
}
No comments:
Post a Comment