[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
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
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
Re: [RESOLVED] DropDownList PostBack issue.
Good stuff, glad to hear that you got it working!
Gary