Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SelectedIndexChanged does not fire

Status
Not open for further replies.

ARCITS

Programmer
Apr 4, 2002
99
GB
I have a problem with a dropdownlist in ASP.Net
I want to capture the 'SelectedIndexChanged' event and populate a label or textbox on the page.
However the event does not fire when I make the selection in the listbox.
It only fires when I click another command button on the page.
I have read a couple of posts on Tek-Tips but I am still unclear what the problem is - is it connected with 'postback'?

This is what I am trying to do ...


Private Sub lstCustomerList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstCustomerList.SelectedIndexChanged

' get the selected value
Dim currItem As String = lstCustomerList.SelectedItem.ToString()

' populate the label
lblFullCustomerName.Text = currItem

End Sub


Any help appreciated...


Thanks!
 
Make sure that AutoPostBack is enabled in the ddl:
Code:
<asp:DropDownList ID=&quot;myDdl&quot; Runat=server AutoPostBack=True />
 
Set the AutoPostBack property on your control to true.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top