SelectedIndexChanged event of a DropDownList sometimes not firing

Discussion in 'ASP .Net' started by Lew Barnesson, Dec 4, 2004.

  1. Hi All,

    I have looked and looked for an answer to the following problem (without
    success), and would be very grateful for a solution. The problem:

    The SelectedIndexChanged event code of an Asp.Net DropDownList changes text
    in an adjacent TextBox by either concatenating SelectedItem.Text (from the
    DropDownList) if it is not in the TextBox, or removing it if it is in the
    TextBox. This generally works very well.

    The problem occurs when I click on the TextBox, and add some text manually.
    When I return to the DropDownList (click on the list), the list drops down,
    then goes right back up *without* firing the SelectedIndexChanged event. On
    the next click, the list again behaves normally (i.e., the list drops down,
    and I can select an entry). (But note that if I had just clicked on the
    TextBox without adding text and then return to the DropDownList, all goes
    well.)

    Any advice appreciated....

    - Lew
    Lew Barnesson, Dec 4, 2004
    #1
    1. Advertising

  2. Lew Barnesson

    Jeff Evans Guest

    Lew Barnesson < > wrote:

    <snip>

    > note that if I had just clicked on the TextBox without adding text and
    > then return to the DropDownList, all goes well.)


    This makes me wonder... does the textbox do autopostback when its text is
    changed? If so, it would fire and could be messing up your DropDownList
    event.
    Jeff Evans, Dec 4, 2004
    #2
    1. Advertising

  3. Jeff,

    Thanks. That's the answer! But, I need AutoPostBack on that control, so
    guess I'll have to work around it (maybe in Page_Load :) ). -Lew

    "Jeff Evans" <jwevans1@you_eye_you_see.edu> wrote in message
    news:...
    > Lew Barnesson < > wrote:
    >
    > <snip>
    >
    >> note that if I had just clicked on the TextBox without adding text and
    >> then return to the DropDownList, all goes well.)

    >
    > This makes me wonder... does the textbox do autopostback when its text is
    > changed? If so, it would fire and could be messing up your DropDownList
    > event.
    >
    >
    Lew Barnesson, Dec 4, 2004
    #3
  4. Jeff,

    Turns out I don't need AutoPostBack for that control. Now all is working.
    Thanks for your help! - Lew

    "Lew Barnesson" <> wrote in message
    news:...
    > Jeff,
    >
    > Thanks. That's the answer! But, I need AutoPostBack on that control, so
    > guess I'll have to work around it (maybe in Page_Load :) ). -Lew
    >
    > "Jeff Evans" <jwevans1@you_eye_you_see.edu> wrote in message
    > news:...
    >> Lew Barnesson < > wrote:
    >>
    >> <snip>
    >>
    >>> note that if I had just clicked on the TextBox without adding text and
    >>> then return to the DropDownList, all goes well.)

    >>
    >> This makes me wonder... does the textbox do autopostback when its text is
    >> changed? If so, it would fire and could be messing up your DropDownList
    >> event.
    >>
    >>

    >
    >
    Lew Barnesson, Dec 4, 2004
    #4
    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. DesignerX
    Replies:
    2
    Views:
    3,831
    Bob Carsto
    Nov 14, 2003
  2. Paul Lacey
    Replies:
    2
    Views:
    2,705
    =?Utf-8?B?TmlrYW5kZXIgJiBNYXJncmlldCBCcnVnZ2VtYW4=
    Feb 17, 2005
  3. hal
    Replies:
    2
    Views:
    1,779
    =?Utf-8?B?SmVyZW15IERhdmlz?=
    Sep 13, 2004
  4. =?Utf-8?B?Q3VybHlGcm8=?=

    dropdownlist selectedIndexChanged event not firing

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

    DropDownList.SelectedIndexChanged event not firing

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

Share This Page