CheckBoxList::OnPreRender Method
Configures the CheckBoxList control prior to rendering on the client.
Assembly: System.Web (in System.Web.dll)
The OnPreRender method is used primarily by control developers in custom controls that derive from the CheckBoxList class. The OnPreRender method allows derived classes to handle the PreRender event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
The OnPreRender method performs any necessary prerendering steps prior to saving view state and rendering content for the CheckBoxList. The individual list items contained in the CheckBoxList control are initialized for rendering using the current AutoPostBack, CausesValidation, and ValidationGroup values.
Notes to InheritorsWhen overriding OnPreRender in a derived class, be sure to call the base class's OnPreRender method so that registered delegates receive the event.
The following code example demonstrates how to override the CreateControlStyle method in a custom server control so that it always returns a new instance of the TableStyle class for the CheckBoxList.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.