HELP? Cookie object use (code behind). so much easy with ASP/COM+

Discussion in 'ASP .Net' started by =?Utf-8?B?Y2hyaXM=?=, May 31, 2004.

  1. Suggested that I move my question to this post, HELP

    I'm struggling with using the HttpCookie object on a code behind. Used in the page works great
    I'm getting a: Type 'HttpCookie' is not define

    I've tried adding the namespace to the vb form but no luck

    Imports System.Data.Sqlclien
    Imports System.Dat
    Imports Syste
    Imports System.Web.U
    Imports System.Web.UI.WebControl
    Imports System.Web.UI.HtmlControl
    Imports System.Web.HttpCooki

    It's use

    'Now set cooki
    Dim objCookie As New HttpCookie("nasbawebsitenew"
    objCookie.Values("userid") = memberdata3("USER_EMAIL"
    objCookie.Values("userpassword") = memberdata3("USER_PASSWORD"
    objCookie.Values("datecreated") = Date.Now(
    objCookie.Expires = DateTime.MaxValu
    Response.Cookies.Add(objCookie
    =?Utf-8?B?Y2hyaXM=?=, May 31, 2004
    #1
    1. Advertising

  2. Try "Imports System.Web" instead of "Imports System.Web.HttpCookie".

    --
    John Saunders
    johnwsaundersiii at hotmail


    "chris" <> wrote in message
    news:...
    > Suggested that I move my question to this post, HELP?
    >
    > I'm struggling with using the HttpCookie object on a code behind. Used in

    the page works great.
    > I'm getting a: Type 'HttpCookie' is not defined
    >
    > I've tried adding the namespace to the vb form but no luck.
    >
    > Imports System.Data.Sqlclient
    > Imports System.Data
    > Imports System
    > Imports System.Web.UI
    > Imports System.Web.UI.WebControls
    > Imports System.Web.UI.HtmlControls
    > Imports System.Web.HttpCookie
    >
    > It's use:
    >
    > 'Now set cookie
    > Dim objCookie As New HttpCookie("nasbawebsitenew")
    > objCookie.Values("userid") = memberdata3("USER_EMAIL")
    > objCookie.Values("userpassword") =

    memberdata3("USER_PASSWORD")
    > objCookie.Values("datecreated") = Date.Now()
    > objCookie.Expires = DateTime.MaxValue
    > Response.Cookies.Add(objCookie)
    >
    John Saunders, May 31, 2004
    #2
    1. Advertising

  3. that was the trick! question is I do 'system.web 'does that mean everything in web (system.web) is open for use? if so, why not just inherit/import system????????????
    =?Utf-8?B?Y2hyaXM=?=, May 31, 2004
    #3
  4. No, System.Web is just System.Web.

    --
    John Saunders
    johnwsaundersiii at hotmail


    "chris" <> wrote in message
    news:...
    > that was the trick! question is I do 'system.web 'does that mean

    everything in web (system.web) is open for use? if so, why not just
    inherit/import system????????????
    John Saunders, Jun 1, 2004
    #4
    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 Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    582
    Alphonse Giambrone
    Jun 28, 2003
  2. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    482
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  3. cpp4ever
    Replies:
    3
    Views:
    369
    Francesco
    Sep 8, 2009
  4. Raymond Schanks
    Replies:
    0
    Views:
    520
    Raymond Schanks
    Apr 11, 2010
  5. Drago
    Replies:
    0
    Views:
    75
    Drago
    May 15, 2004
Loading...

Share This Page