DropDownList "SelectedIndexChanged" event

Discussion in 'ASP .Net Web Controls' started by Greg Smith, Nov 12, 2003.

  1. Greg Smith

    Greg Smith Guest

    I am working on my first web app. The SelectedIndexChanged event for the
    DropDownList control doesn't seem to fire when the item is changed.
    Obviously there is something more I need to do. Can anybody fill me in?

    Any help is greatly appreciated.
     
    Greg Smith, Nov 12, 2003
    #1
    1. Advertising

  2. I had the same problem. You need to set the autopostback on the listbox
    control parameters. You need to send the page back to the server to
    respond to the event.

    You would think this would happen automatically with the event but it
    doesn't. Apparently it is intended to leave that processing control in
    your hands to determine when to cause an autopostback.....

    Hope this helps move you on your way....


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    helper of codes, Nov 12, 2003
    #2
    1. Advertising

  3. Greg Smith

    Greg Smith Guest

    Thanks!

    "helper of codes" <> wrote in message
    news:%...
    >
    > I had the same problem. You need to set the autopostback on the listbox
    > control parameters. You need to send the page back to the server to
    > respond to the event.
    >
    > You would think this would happen automatically with the event but it
    > doesn't. Apparently it is intended to leave that processing control in
    > your hands to determine when to cause an autopostback.....
    >
    > Hope this helps move you on your way....
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Greg Smith, Nov 12, 2003
    #3
  4. Greg Smith

    Pai Guest

    "Greg Smith" <> wrote in message news:<>...
    > I am working on my first web app. The SelectedIndexChanged event for the
    > DropDownList control doesn't seem to fire when the item is changed.
    > Obviously there is something more I need to do. Can anybody fill me in?
    >
    > Any help is greatly appreciated.


    u need to set the AutoPostBack Propoerty of the control to true......
     
    Pai, Nov 12, 2003
    #4
  5. Greg Smith

    MSFT Guest

    MSFT, Nov 13, 2003
    #5
  6. Greg Smith

    Greg Smith Guest

    > I had the same problem. You need to set the autopostback on the listbox
    > control parameters. You need to send the page back to the server to
    > respond to the event.
    >
    > You would think this would happen automatically with the event but it
    > doesn't. Apparently it is intended to leave that processing control in
    > your hands to determine when to cause an autopostback.....


    Opps! just ran into another problem. I am loading the DropDownList in the
    Page_load event. When I click on the control it posts back and fires the
    page_load event and I double up on the items listed in the control. If I
    put a "Clear" in there first then it looks fine but I have lost my
    selection. It is back at an index of 0;

    Is there a better way of doing this?
     
    Greg Smith, Nov 13, 2003
    #6
  7. Greg Smith

    MSFT Guest

    Hi Greg,

    You can determine if the the page is postback or not, and then deside if
    add the items again. For example:

    If not IsPostBack then
    ...

    End If

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    MSFT, Nov 14, 2003
    #7
    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. Dominic
    Replies:
    2
    Views:
    726
    Saravana
    Jul 4, 2003
  2. Robert Hanson
    Replies:
    0
    Views:
    534
    Robert Hanson
    Jul 10, 2003
  3. Robert Hanson
    Replies:
    0
    Views:
    465
    Robert Hanson
    Jul 10, 2003
  4. Pepito Grillo

    SelectedIndexChanged event in DropDownList

    Pepito Grillo, Jul 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    431
    Pepito Grillo
    Jul 28, 2003
  5. DesignerX
    Replies:
    2
    Views:
    3,842
    Bob Carsto
    Nov 14, 2003
Loading...

Share This Page