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?
 
Ad

Advertisements

Ad

Advertisements

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.
 

Top