dropdownlist selectedindexchanged event not firing.. please help.

Discussion in 'ASP .Net' started by DesignerX, Oct 20, 2003.

  1. DesignerX

    DesignerX Guest

    I have a dynamically created composite server control.

    The composite control contains a dropdownlist, a validator and a label.

    I have the dropdownlist AutoPostBack set to true and have defined a handler
    for the SelectedIndexChanged event.

    The server control is instantiated upon every request.

    It currently adds 2 items to the dropdownlist from the database.


    The dropdownlist selected value is preserved across postbacks, but the event
    is only fired when the 2nd item in the list is selected... I'm lost.. why
    not the first?

    Thanks in advance,
    Stan
     
    DesignerX, Oct 20, 2003
    #1
    1. Advertising

  2. Is it because the SelectedIndex to begin with is 0? So if you pick the first
    item, the SelectedIndex doesn't change and the event won't fire. Can you set
    the SelectedIndex to -1 when you load the dropdown?

    I had the same problem once and that is how I got around it.

    -Darrin


    "DesignerX" <> wrote in message
    news:...
    >
    > I have a dynamically created composite server control.
    >
    > The composite control contains a dropdownlist, a validator and a label.
    >
    > I have the dropdownlist AutoPostBack set to true and have defined a

    handler
    > for the SelectedIndexChanged event.
    >
    > The server control is instantiated upon every request.
    >
    > It currently adds 2 items to the dropdownlist from the database.
    >
    >
    > The dropdownlist selected value is preserved across postbacks, but the

    event
    > is only fired when the 2nd item in the list is selected... I'm lost.. why
    > not the first?
    >
    > Thanks in advance,
    > Stan
    >
    >
    >
    >
    >
     
    Darrin J Olson, Oct 20, 2003
    #2
    1. Advertising

  3. DesignerX

    Bob Carsto Guest

    I have the same problem. Even when I preset to select index to 2,3,4 etc
    when rendering the page. Was your problem related to the fact the the select
    index was initialzied to 0? Have you found a solution?

    "DesignerX" <> wrote in message
    news:...
    >
    > I have a dynamically created composite server control.
    >
    > The composite control contains a dropdownlist, a validator and a label.
    >
    > I have the dropdownlist AutoPostBack set to true and have defined a

    handler
    > for the SelectedIndexChanged event.
    >
    > The server control is instantiated upon every request.
    >
    > It currently adds 2 items to the dropdownlist from the database.
    >
    >
    > The dropdownlist selected value is preserved across postbacks, but the

    event
    > is only fired when the 2nd item in the list is selected... I'm lost.. why
    > not the first?
    >
    > Thanks in advance,
    > Stan
    >
    >
    >
    >
    >
     
    Bob Carsto, Nov 14, 2003
    #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. Paul Lacey
    Replies:
    2
    Views:
    2,721
    =?Utf-8?B?TmlrYW5kZXIgJiBNYXJncmlldCBCcnVnZ2VtYW4=
    Feb 17, 2005
  2. Lew Barnesson
    Replies:
    3
    Views:
    823
    Lew Barnesson
    Dec 4, 2004
  3. =?Utf-8?B?Q3VybHlGcm8=?=

    dropdownlist selectedIndexChanged event not firing

    =?Utf-8?B?Q3VybHlGcm8=?=, Aug 14, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,640
    =?Utf-8?B?Q3VybHlGcm8=?=
    Aug 14, 2005
  4. BentleyInc

    DropDownList.SelectedIndexChanged event not firing

    BentleyInc, Dec 10, 2004, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    1,361
    Steven Cheng[MSFT]
    Dec 14, 2004
  5. Dabbler

    DropDownList selectedIndexChanged event not firing

    Dabbler, May 6, 2005, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    856
    Josh Behl
    Aug 13, 2006
Loading...

Share This Page