Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cant get value from a cookie to a dropdown list

Posted on 2006-06-13
2
Medium Priority
?
307 Views
Last Modified: 2010-04-16
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

value="books&CD"

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

request.Form["typeB"].Replace("&", "*");

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.

Thanks
0
Comment
Question by:mousemat24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
t_itanium earned 2000 total points
ID: 16900192
y r u using:
typeB.Items.FindByValue(cookie["media"].Replace("*", "&"));??

y don't u use just

cookie["media"].Replace("*", "&");
0
 

Author Comment

by:mousemat24
ID: 16901406
sorry my mistake, thanks for that t_itanium
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question