1 dropdown among many won't hold it's state... why?

V

vtxr1300

I've got a really big page with a few different panels and controls on
each panel. On panel 1 are many dropdownlists. The one list will not
hold state but the others do. I've checked everything I can think of.
I'm not rebinding data to the ddlist or changing the selectedindex at
anytime during postback. I only bind data to it upon the page's first
load. I've set enableviewstate=true which since the rest of the page
is holding state, I figured it should be that way anyway, but nothing.
Anyone know what else I can look at? This is VS2005 if that makes a
difference. Thanks.
 
E

Eliyahu Goldin

By any chance, you don't share the same item list between multiple ddls, do
you?

Eliyahu
 
V

vtxr1300

No I'm not doing that. In fact, I've tried it without binding anything
to the list and hard coding the list items in the html, but still no
dice.
 
V

vtxr1300

Okay, I finally figured out why it's not holding state, but I'm not
sure what to do to fix it. Basically my list has a 5 items. At this
point, each item has the same value, just a different text value. I
changed it so that each listitems value is different and now it holds
the state. So, since each listitem's value=11, it just selects the
first item with the value 11 in the list. Shouldn't it select it based
off of selectedIndex and not selectedValue?
 
E

Eliyahu Goldin

As a workaround you can handle a client side event raised on the ddl
selected item change. In the event you can save the selected item index in a
hidden input control and pass it on to the server side.

Eliyahu
 

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
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top