BaseValidator.OnInit Method
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Raises the Init event.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Parameters
- e
- Type: System.EventArgs
A System.EventArgs that contains the event data.
After this method calls the base control's OnInit method, it sets the ForeColor property to Red if the following conditions are true:
The ForeColor property is not already set.
The 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.
Notes to InheritorsWhen overriding OnInit in a derived class, be sure to call the base class's OnInit method so that registered delegates receive the event.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.