By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

dropdownlist does not retain its selectedindex value on postback.

P: n/a
Hi,

I have a dropdownlist in a grid header template - i have autopostback on but
when i check the selectedindex in the page_load event (i have a routine
which identifies the control that caused the postback and it determines the
dropdownlist correctly) it is always 0 - i am NOT rebinding to the
dropdownlist in the page_load event i.e. only once if !postback. I also have
viewstate set to true for the control and the grid it is in! The grid is
embedded in a nested set of html tables. Any idea why the selected index is
not retained..and also when the page is redisplayed after the postback the
dropdownlist is reset to the first item in the dropdownlist?

Thanks for any help!

Any ideas?
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"John Blair" <jo********@hotmail.com> wrote in
news:i9*****************@newsfe4-gui.ntli.net:
I have a dropdownlist in a grid header template - i have autopostback
on but when i check the selectedindex in the page_load event (i have a
routine which identifies the control that caused the postback and it
determines the dropdownlist correctly) it is always 0


Do you by any chance have a SelectedIndexChanged handler? That is where the
SelectedIndex gets updated.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2

P: n/a
Hi,

Thanks for the feedback.
I found out the cause of my situation - my grid is in a web page that also
includes an XML control - that thru XSLT generates a variety
of <Form></form> tags that when embedded in the main page <form> tag causes
the selections to go amiss - removed the XML control and all worked
perfectly!

Thanks.

"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@127.0.0.1...
"John Blair" <jo********@hotmail.com> wrote in
news:i9*****************@newsfe4-gui.ntli.net:
I have a dropdownlist in a grid header template - i have autopostback
on but when i check the selectedindex in the page_load event (i have a
routine which identifies the control that caused the postback and it
determines the dropdownlist correctly) it is always 0


Do you by any chance have a SelectedIndexChanged handler? That is where
the
SelectedIndex gets updated.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.