dynamic listItems - event NOT fired

Discussion in 'ASP .Net Web Controls' started by preetith, Aug 26, 2003.

  1. preetith

    preetith Guest

    Hello,
    Though there are numerous posts on this issue , there
    are no answers at all to any of them !!
    My Situation is , I have a dropdownlist that gets
    populated on a button click event, this works fine but
    when I select an item on this dropdownlist ,
    SelectedIndexChanged event does not get fired.The reason
    is that the dynamically created listitems are lost between
    the posts ...Can someone provide a solution to my problem ?

    thanks,
    preeti
     
    preetith, Aug 26, 2003
    #1
    1. Advertising

  2. preetith

    Alvin Bruney Guest

    There are answers but people only say that because they are too lazy to
    search for it. you must hook your event handler code in page load every
    time. otherwise it won't behave right.

    "preetith" <> wrote in message
    news:07eb01c36ba5$ee8e60b0$...
    > Hello,
    > Though there are numerous posts on this issue , there
    > are no answers at all to any of them !!
    > My Situation is , I have a dropdownlist that gets
    > populated on a button click event, this works fine but
    > when I select an item on this dropdownlist ,
    > SelectedIndexChanged event does not get fired.The reason
    > is that the dynamically created listitems are lost between
    > the posts ...Can someone provide a solution to my problem ?
    >
    > thanks,
    > preeti
    >
     
    Alvin Bruney, Aug 26, 2003
    #2
    1. Advertising

  3. Can you show us the complete code that is failing?

    Do you have autopostback set to true?
    Are you mistakenly resetting the control on each postback?

    Ken

    --
    Microsoft MVPs have a question for *you*: Are you patched against the Worm?
    http://www.microsoft.com/security/security_bulletins/ms03-026.asp



    "preetith" <> wrote in message
    news:07eb01c36ba5$ee8e60b0$...
    Hello,
    Though there are numerous posts on this issue , there
    are no answers at all to any of them !!
    My Situation is , I have a dropdownlist that gets
    populated on a button click event, this works fine but
    when I select an item on this dropdownlist ,
    SelectedIndexChanged event does not get fired.The reason
    is that the dynamically created listitems are lost between
    the posts ...Can someone provide a solution to my problem ?

    thanks,
    preeti
     
    Ken Cox [Microsoft MVP], Aug 27, 2003
    #3
  4. preetith

    preetith Guest

    Thanks Ken and Alvin for replying to my query.
    I had done all that you both have mentioned but what I
    missed was the uniqueID.My DDL is embedded within a TABLE
    heirarchy and all the tables are not given uniqueIDs hence
    the control's event did not get fired.Now am creating the
    DDL dynamically and adding it to the tablecell and it
    automatically receives a uniqueID and remembers it between
    posts.
    regards,
    preeti

    >-----Original Message-----
    >There are answers but people only say that because they

    are too lazy to
    >search for it. you must hook your event handler code in

    page load every
    >time. otherwise it won't behave right.
    >
    >"preetith" <> wrote in message
    >news:07eb01c36ba5$ee8e60b0$...
    >> Hello,
    >> Though there are numerous posts on this issue ,

    there
    >> are no answers at all to any of them !!
    >> My Situation is , I have a dropdownlist that gets
    >> populated on a button click event, this works fine but
    >> when I select an item on this dropdownlist ,
    >> SelectedIndexChanged event does not get fired.The reason
    >> is that the dynamically created listitems are lost

    between
    >> the posts ...Can someone provide a solution to my

    problem ?
    >>
    >> thanks,
    >> preeti
    >>

    >
    >
    >.
    >
     
    preetith, Aug 27, 2003
    #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. jorge
    Replies:
    2
    Views:
    1,341
    jorge
    May 26, 2004
  2. =?Utf-8?B?Sm9l?=

    HtmlSelect control not showing ListItems

    =?Utf-8?B?Sm9l?=, Dec 14, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    696
    =?Utf-8?B?RGF2aWQgQnJhbmNo?=
    Dec 14, 2005
  3. jorge
    Replies:
    1
    Views:
    447
    Teemu Keiski
    May 28, 2004
  4. jorge
    Replies:
    0
    Views:
    342
    jorge
    May 25, 2004
  5. jorge
    Replies:
    0
    Views:
    301
    jorge
    May 25, 2004
Loading...

Share This Page