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

  • Thread starter Thread starter vtxr1300
  • Start date Start date
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.
 
By any chance, you don't share the same item list between multiple ddls, do
you?

Eliyahu
 
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.
 
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?
 
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

Back
Top