System.Web.UI.WebControls Namespace BaseDataList Class
Occurs when the item selected on the list changes between posts to the server.
[ VB ]
Public Event SelectedIndexChanged As EventHandler
[ C# ]
public event EventHandler SelectedIndexChanged;
[ C++ ]
public: __event EventHandler* SelectedIndexChanged;
In [ JScript ], you can handle the events defined by a class, but you cannot define your own.
The method assigned to handle the event is passed an EventArgs object containing data related to the SelectedIndexChanged event.
The SelectedIndexChanged event is raised whenever a different selection in a data listing control is posted to the server.
The SelectedIndexChanged event is typically used in conjunction with a command button whose CommandName property is set to select.
You can implement this command button in either of the following ways:
When the form is posted, the SelectedIndex and SelectedItem properties of the list are updated to refer to the item selected.
The following example demonstrates how to specify a handler for the SelectedIndexChanged event to display the item selected from a DataList.
Show me
BaseDataList Members Allowing Users to Select Items in a DataList Control Allowing Users to Select Items in a DataGrid Control