CheckBoxList::OnPreRender Method (EventArgs^)

 

Configures the CheckBoxList control prior to rendering on the client.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public protected:
virtual void OnPreRender(
	EventArgs^ e
) override

Parameters

e
Type: System::EventArgs^

An EventArgs that contains the event data.

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 Inheritors:

When 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.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: