1. The best way to add style is through CSS:
The above style will add the red border and a yellow background to the control.
The first line of the above function is to get a hidden field called “hdnFailedControlNames”, which stores the names of the controls that failed the validation.
First of all, the function “validatePage()” needs to be called when the Submit button is clicked, so we set the Submit button’s OnClientClick=”validatePage();”