ListBox.OnPreRender(EventArgs) Method

Definition

Configures the ListBox control prior to rendering on the client.

C#
protected override void OnPreRender(EventArgs e);
C#
protected internal override void OnPreRender(EventArgs e);

Parameters

e
EventArgs

An EventArgs object that contains the event data.

Remarks

The OnPreRender method is used primarily by control developers, when deriving a custom control from the ListBox 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 ListBox.

Notes to Inheritors

When overriding the OnPreRender(EventArgs) method in a derived class, be sure to call the OnPreRender(EventArgs) method of the base class so that registered delegates receive the event.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also