Is there anyway to get the previous selected item in a drop down list

K

KJ

Is there anyway to get the previous selected item in a drop down list
when you change the selection?
 
J

Juno

Hi,


If you want to get previous selected item, you can save the current selected
value in viewstate.
When postback, the current selected item becomes previouse item, and you can
get it from viewstate.
 
K

KJ

This works if you dynamically add days to your drop-down, but if you
have 1, 2, and 3 in your drop-down and change it from 3 to 1 on
postback the selected item is 1 not 3. So you will be saving the
selected value 1 in viewstate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top