Dropdown List - reverting to wrong item on postback

GRCHELPDESK
GRCHELPDESK used Ask the Experts™
on
Hello Experts,

I have a dropdown list which is populated based on based on another dropdown list.
This part if working fine.  Values in the dropdown list are similar to this:

Text - Value
CKN - F
CQN - F
CDN - F
DKN - P
DQN - P
DDN - P

The problem I'm running into is that if you select CQN or CDN it changes to CKN on postback.  Also, if you select DQN or DDN, it changes to DKN on postback.  I don't have any logic in place to do that.  I'm suspecting it has to do with different selections having the same value ... but I still don't understand why it's happening or how to fix it.

Thanks,
GRCHELPDESK
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2008

Commented:
How are you checking for post-back in the Page_Load and doing something different?

Bob

Author

Commented:
My pageload only has a small section:
If not page.ispostback then
     'initialize the form
End if

So that shouldn't be affecting a postback.  I have the dropdown list setup to do an auto-postback.  But I removed that and tried manually doing a postback and got the same results.  I'm stumped.

Author

Commented:
Ok, silly question ... is it ok to have multiple selections in the dropdown list with different text but the same values?

Text - Value
CKN - F
CQN - F
CDN - F
DKN - P
DQN - P
DDN - P

I've always assumed that was fine, but this is the first time I've actually tried it.  The reason I ask is because it always reverts back to the first instance of with the selected value.  So if you select CDN (value F) it reverts to CKN.  If you select DQN (value P) it reverts to DKN.

If anyone has input on this I'd appreciate it, I need to get this project rolled out ASAP.
Most Valuable Expert 2012
Top Expert 2008
Commented:
Ok, not so silly question, since the values need to be unique.  

Bob

Author

Commented:
Actually that explains a lot.  This was the first time I ever needed to have multiple values being the same ... it didn't occur to me they needed to be unique.  I can do a work-around easily enough, but it means another hit on the database.  Oh well, what'cha gonna do.

Thanks for the help bob!
GRCHELPDESK

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial