Raises the System.Web.UI.Control.Init event.
- e
- A EventArgs that contains the event data.
After this method calls the base control's System.Web.UI.Control.OnInit(EventArgs) method, it sets the WebControl.ForeColor property to System.Drawing.Color.Red if the following conditions are true:
The WebControl.ForeColor property is not already set.
The System.Web.UI.Control.RenderingCompatibility property indicates an ASP.NET version earlier than 4.0. By default, validator controls in ASP.NETÂ 4 and later versions do not display errors in red. For information about how to control the visual appearance of validator controls, see Validating User Input in ASP.NET Web Pages.
This method also registers the validation control on the page.