DropDownList SelectedIndexChanged not firing

Set the AutoPostBack = “True” for the listbox.

 

Markup

<asp:DropDownListID=”DropDownList1″runat=”server”AutoPostBack=”true”
OnSelectedIndexChanged=”DropDownList1_SelectedIndexChanged”>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>

CodeBehind 

ProtectedSub DropDownList1_SelectedIndexChanged(ByVal sender AsObject, ByVal e As System.EventArgs)
Response.Write(DropDownList1.SelectedIndex)
EndSub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s