Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Name 'response' is not declared HELP!!


Message #1 by "John Hamman {Hamman Interactive}" <johnhamman@C...> on Wed, 17 Apr 2002 22:17:36 -0400
Hi all, Im getting an error in VS.NET when i am trying to write a sub in a
class file.
this is my code.:

Imports System
Imports System.Web
Imports System.Web.HttpCookie

Public Class detect
    Public Sub flash()
        'create cookie
        'blah
        Response.AppendCookie(Cookie)

    End Sub

End Class

in my code it tells me that "Name 'response' is not declared"
can anyone tell me why this is doing this? I get this error evertime i want
to create an class.vb file with a response object in it?

john

Message #2 by "Steven A Smith" <ssmith@a...> on Wed, 17 Apr 2002 22:33:17 -0400
Your class needs a reference to the HttpContext.  Use
System.Web.HttpContext.Current.Response.AppendCookie(Cookie).

Steve

----- Original Message -----
From: "John Hamman {Hamman Interactive}" <johnhamman@C...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Wednesday, April 17, 2002 10:17 PM
Subject: [aspx_beginners] Name 'response' is not declared HELP!!


>
> Hi all, Im getting an error in VS.NET when i am trying to write a sub in a
> class file.
> this is my code.:
>
> Imports System
> Imports System.Web
> Imports System.Web.HttpCookie
>
> Public Class detect
>     Public Sub flash()
>         'create cookie
>         'blah
>         Response.AppendCookie(Cookie)
>
>     End Sub
>
> End Class
>
> in my code it tells me that "Name 'response' is not declared"
> can anyone tell me why this is doing this? I get this error evertime i
want
> to create an class.vb file with a response object in it?
>
> john
>
>
>

Message #3 by "John Hamman {Hamman Interactive}" <johnhamman@C...> on Wed, 17 Apr 2002 23:08:59 -0400
Thanks, i was trying to figure out why it would work in the page but not
outside a page. now i know.!
john

-----Original Message-----
From: Steven A Smith [mailto:ssmith@a...]
Sent: Wednesday, April 17, 2002 10:33 PM
To: aspx_beginners
Subject: [aspx_beginners] Re: Name 'response' is not declared HELP!!


Your class needs a reference to the HttpContext.  Use
System.Web.HttpContext.Current.Response.AppendCookie(Cookie).

Steve

----- Original Message -----
From: "John Hamman {Hamman Interactive}" <johnhamman@C...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Wednesday, April 17, 2002 10:17 PM
Subject: [aspx_beginners] Name 'response' is not declared HELP!!


>
> Hi all, Im getting an error in VS.NET when i am trying to write a sub in a
> class file.
> this is my code.:
>
> Imports System
> Imports System.Web
> Imports System.Web.HttpCookie
>
> Public Class detect
>     Public Sub flash()
>         'create cookie
>         'blah
>         Response.AppendCookie(Cookie)
>
>     End Sub
>
> End Class
>
> in my code it tells me that "Name 'response' is not declared"
> can anyone tell me why this is doing this? I get this error evertime i
want
> to create an class.vb file with a response object in it?
>
> john
>
>
>




  Return to Index