SelectedIndexChanged event doesn't fire for Listbox or DropdownList

C

CW

Yes, Autopostback is true, and it doesn't make an iota of difference at all.

HTML snippet and code (behind) snippet is as below:

<asp:dropdownlist id="ddlLoginType" runat="server" Width="163px"
AutoPostBack="True"></asp:dropdownlist>



Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load


If Not Me.Page.IsPostBack Then
Me.ddlLoginType.Items.Add("Customers")
Me.ddlLoginType.Items.Add("Sales Rep")
Me.ddlLoginType.Items.Add("Admin")

End If
End Sub



Private Sub ddlLoginType_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles ddlLoginType.SelectedIndexChanged

....

End sub



I have changed the DDL to a Listbox and the same problem.
SelectedIndexChanged event never ever fires!



Any idea?
 
C

CW

I originally had the <form id="form1" runat="server"> and its associated
<form/> tag around the outside the body tag.

Once I place them inside the body tag, everything seemed to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top