converting cookie values

Discussion in 'ASP .Net' started by mike parr, May 11, 2004.

  1. mike parr

    mike parr Guest

    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!
     
    mike parr, May 11, 2004
    #1
    1. Advertising

  2. mike parr

    avnrao Guest

    can you check whats there in strCookieValue while adding it to the cookie?

    Av.
    "mike parr" <> wrote in message
    news:...
    > 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!
     
    avnrao, May 11, 2004
    #2
    1. Advertising

  3. mike parr

    mike parr Guest

    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!
     
    mike parr, May 11, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    3
    Views:
    5,916
    Steven Cheng[MSFT]
    Jun 3, 2004
  2. Shapper

    Cookie and Session Cookie Questions.

    Shapper, Apr 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    596
  3. =?Utf-8?B?UGF1bA==?=

    Cookie Question (IP as domain and cookie file location)

    =?Utf-8?B?UGF1bA==?=, Jan 10, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,517
    Bruce Barker
    Jan 10, 2006
  4. ad
    Replies:
    2
    Views:
    7,639
    Kevin Spencer
    Jan 27, 2006
  5. =?Utf-8?B?TnVubw==?=

    Convert a PHP cookie to an ASP.NET cookie

    =?Utf-8?B?TnVubw==?=, Jan 31, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    456
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 31, 2006
Loading...

Share This Page