Author: Mr_Menon | Posted on: 10/13/2010 3:59:57 PM | Views : 278

Hello ,


I have the following problem:
Here is the server side code :




void Page_PreRender() { foreach (RequiredFieldValidator valcontrol in Page.Validators) { WebControl assControl = (WebControl)Page.FindControl(valcontrol.ControlToValidate); if (!valcontrol.IsValid) { assControl.BackColor = System.Drawing.Color.Gray; } else { assControl.BackColor = System.Drawing.Color.Violet; } } }

in the client side code I have three Requiredfieldvalidators.I will write the code for one of them in order to give you an idea:

<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" Text="(Required)&q ...

Go to the complete details ...