Results 1 to 4 of 4

Thread: [RESOLVED] DropDownList PostBack issue.

  1. #1
    Frenzied Member
    Join Date
    Feb 08
    Location
    Texas
    Posts
    1,237

    Resolved [RESOLVED] DropDownList PostBack issue.

    Ok, I have two dropdownlists on my page and when the selected index changes I want to create cookies that store the index for resetting the index if someone leaves the page and comes back later.

    I also have text entries and add buttons for those entries that store the data into the database and shows it in a datagrid on the page. There is a remove button too.

    So here is what's happening.

    When I change the DropDownList's SelectedIndex, nothing happens. But if I enter data into the text entries and press the Add button, then the DropDownList's event is fired off... But not the Add buttons's event?!

    I've been removing UserControls that I thought maybe blocking the post back, but it's still happening.

    Any ideas?

    Thanks,

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,738

    Re: DropDownList PostBack issue.

    Hello,

    Due to the way that ASP.NET Controls work, the SelectedIndex event will not fire unless a postback occurs to the server.

    In your case, the AutoPostBack property of the Add Button is automatically set to true, but the AutoPostBack property of the DropDownList is set to false.

    If you want the SelectedIndex event to immediately, then you are going to need to change this property to true.

    Gary

  3. #3
    Frenzied Member
    Join Date
    Feb 08
    Location
    Texas
    Posts
    1,237

    Re: DropDownList PostBack issue.

    Thanks for the reply .

    I had figured this out by further investigating the differences in the properties. I should have done that earlier, but I was confused at the time lol.

    Thanks again and it's working now!

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  4. #4
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,738

    Re: [RESOLVED] DropDownList PostBack issue.

    Good stuff, glad to hear that you got it working!

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •