Cant get value from a cookie to a dropdown list
Posted on 2006-06-13
Hi there, wonder if you guys can help me. I'm new to C# and I have the following problem
I have a dropdown list, all the value are ok, bar 1, the value of that is
when a user selects this options, the result is stored in a cookie, because I had problems with the & I to change it to a *. So ...
I have another form that reads the value from the cookie and it selects the correct value the user has selected. So this is the code I have:
selected = typeB.Items.FindByValue(cookie["media"].Replace("*", "&"));
For some strange reason, this wont work? Any idea as to why this isnt working. So the code **Should** of selected the value book books&CD.
my cookie has books*CD
Thanks Guys, hope you can help out.