Setting cookies from a Custom Server Control

Discussion in 'ASP .Net' started by aBs0lut30@gmail.com, Nov 9, 2005.

  1. Guest

    Hi, i need a little help. I am trying to get a new server control up
    and running (my 3rd) but am having some trouble this go round. I am
    trying to set and/or read a cookie from my server control. The problem
    i am running into is that i cant seem to be able to get it to actually
    set the cookie.

    i have tried getting to the request var. via passing it in through a
    public property, and accessing it through parent.page.request
    same for response.

    But the cookie never gets saved, and the request.cookies.count is
    always 0

    What am i doing wrong??

    Thanks for the help
     
    , Nov 9, 2005
    #1
    1. Advertising

  2. JuanCri Guest

    To save a cookie, try:

    this.Context.Response.Cookies.Add (newCookie);

    Juan C. Olivares
    www.juancri.com
     
    JuanCri, Nov 9, 2005
    #2
    1. Advertising

  3. Guest

    Very nice, works perfect, thanks a lot man :)
     
    , Nov 10, 2005
    #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. Alex Nitulescu

    Response.Cookies vs Request.Cookies

    Alex Nitulescu, Feb 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    8,501
    Hans Kesting
    Feb 3, 2005
  2. Charles Zhang
    Replies:
    4
    Views:
    499
    Steven Cheng[MSFT]
    Oct 10, 2006
  3. _Who
    Replies:
    7
    Views:
    2,685
  4. Matt Sokol
    Replies:
    2
    Views:
    390
    Theo Tillotson
    Aug 7, 2003
  5. Tim
    Replies:
    0
    Views:
    205
Loading...

Share This Page