|
-
Aug 17th, 2012, 08:44 AM
#1
Thread Starter
Frenzied Member
[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
-
Aug 18th, 2012, 01:59 PM
#2
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
-
Aug 20th, 2012, 07:36 AM
#3
Thread Starter
Frenzied Member
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
-
Aug 20th, 2012, 08:36 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|