473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

converting cookie values

I'm creating a cookie by this method :

HttpCookie objCookie = new HttpCookie(strCookieName);
Response.Cookies.Clear();
Response.Cookies.Add(objCookie);
objCookie.Values.Add(strCookieName, strCookieValue);

But when I read the cookie, I can't convert the value (strCookieValue)
to an integer. I get the error 'Input string was not in a correct
format'.
Can anybody help me out with this?
Thanks,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
2 1175
can you check whats there in strCookieValue while adding it to the cookie?

Av.
"mike parr" <mp********@yahoo.co.uk> wrote in message
news:ec**************@TK2MSFTNGP09.phx.gbl...
I'm creating a cookie by this method :

HttpCookie objCookie = new HttpCookie(strCookieName);
Response.Cookies.Clear();
Response.Cookies.Add(objCookie);
objCookie.Values.Add(strCookieName, strCookieValue);

But when I read the cookie, I can't convert the value (strCookieValue)
to an integer. I get the error 'Input string was not in a correct
format'.
Can anybody help me out with this?
Thanks,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
Thanks, I found a solution...I was reading the name-value pair instead
of just the value.
Mike
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: pwldev | last post by:
Sorry if this isn't a good place for this question. I have a problem with losing cookie values whenever a user's local machine date/time is behind the date & time of the IIS machine. The login...
4
by: Wally | last post by:
I have a record set (rs) that contains 25 barcodes values that I set to true in a cookie. (see code section below) If I read the cookie from within the same page that created it, I see all 25...
6
by: Jason Collins | last post by:
There seems to be an inconsistency (bug?) in the way the Set-Cookie header is handled by the WebHeaderCollection. That is, the values of Set-Cookie, when an Expires is specified, contain the ","...
3
by: Wysiwyg | last post by:
After a server created cookie is processed on the client I want it removed, cleared, or expired in the javascript block but have been unable to do this. If I set a cookie value in the server code...
5
by: Miljana | last post by:
Hi, I have one problem with cookies in ASP.NET application. It seems that I can not retreive cookie from Request.Cookies collection. I put cookie in Response.Cookies collection, and after page...
1
by: William | last post by:
ERROR: Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. This if then statement only works if a cookie exists. It fails if the cookie...
0
by: tshad | last post by:
I can add a cookie fine, but I can't seem to figure out how to change the value of a cookie and save it back. My code looks like: if (passwordSaveCookie.checked) then If...
1
by: CR1 | last post by:
I found a great cookie script below, but don't know how to make it also pass the values sent to the cookie, to a querystring as well for tracking purposes. Can anyone help? If there was a way to...
4
by: D. | last post by:
Hi, I defined some cookies in order to pass values between pages in my application. The problem is that when i request them with: cookie = Request.Cookies("mycookie") x = cookie.Value (suppose...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.