System.Web.UI.WebControls Namespace ListControl Class
Occurs when the selection on the list changes and is posted back 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.
This event is raised whenever the selection from a list control changes and is posted back to the server.
This event is typically used in conjunction with the AutoPostBack property of the control, to automatically submit the Web Form back to the server when a user changes the selection from the list.
For more information about handling events, see Web Forms Events Model.
The following example shows how to set the method that will receive control when the SelectedIndexChanged event for a DropDownList control occurs.
Select Table <asp:dropdownlist id = "tblList" datatextfield = "Table_Name"
autopostback onSelectedIndexChanged = "getFields" runat = "server" />
The following examples illustrate using a list control's SelectedIndexChanged event in varied scenarios.
ListControl Members SelectedIndex AutoPostBack