I am currently storing data in a cookie (an ID from a database) which i then want to retrieve and use to generate a file name for an uploaded file later on, which will be stored on disk.
I get the error "Cast from type 'HttpCookie' to type 'String' is not valid". I assume i need to find a way to convert the data to string?
A little help pleeeze, code examples too ;-)
Sounds like you may have missed specifing the value property.
If you're trying to get the value into a string variable, for instance, something like this:
Dim var As String
var = Request.Cookies("myCookie").Value
i realize that this is an older post, but i found some info on here that was useful, and i wanted to post a follow up question.
when i enter the code as listed above and write out the contents of the var string, i get the following:
this comes from a username value of "darren". is there a way to get this out of the format it's currently in and back to the "darren" form so that I can use it as a search parameter on my database? thanks!