System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged Method

Raises the ListControl.SelectedIndexChanged event. This allows you to provide a custom handler for the event.

Syntax

protected virtual void OnSelectedIndexChanged (EventArgs e)

Parameters

e
A EventArgs that contains the event data.

Remarks

The ListControl.SelectedIndexChanged event is raised when the selection from the list control changes between posts to the server.

Note:

A list control must persist some values between posts to the server for this event to work correctly. Be sure that view state is enabled for the list control.

Raising an event invokes the event handler through a delegate. For more information, see Consuming Events.

The ListControl.OnSelectedIndexChanged(EventArgs) method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0