SelectedIndexChanged event doesn't fire for Listbox or DropdownList

Discussion in 'ASP .Net' started by CW, Apr 9, 2004.

  1. CW

    CW Guest

    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?
    CW, Apr 9, 2004
    #1
    1. Advertising

  2. CW

    Chris Taylor Guest

    Is enableViewState set to true for the Page?

    Chris Taylor
    http://dotnetjunkies.com/weblog/chris.taylor

    "CW" <a> wrote in message news:#...
    > 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?
    >
    >
    >
    Chris Taylor, Apr 9, 2004
    #2
    1. Advertising

  3. CW

    CW Guest

    Fixed it - because the location of form tag

    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.

    "CW" <a> wrote in message news:#...
    > 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?
    >
    >
    >
    CW, Apr 9, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel
    Replies:
    2
    Views:
    861
    Steven Cheng[MSFT]
    Jun 9, 2004
  2. Daniel
    Replies:
    7
    Views:
    4,366
    Steven Cheng[MSFT]
    Jun 10, 2004
  3. =?Utf-8?B?SmFjaw==?=

    Dropdown list - SelectedIndexChanged event doesn't fire

    =?Utf-8?B?SmFjaw==?=, Mar 14, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,495
    =?Utf-8?B?SmFjaw==?=
    Mar 14, 2005
  4. Damien
    Replies:
    7
    Views:
    695
    Mark Rae
    Jan 26, 2007
  5. MarkMurphy
    Replies:
    5
    Views:
    419
    Steven Cheng[MSFT]
    Aug 27, 2004
Loading...

Share This Page