HttpContext Response vs. HttpApplication Response

  • Thread starter Thread starter Doogie
  • Start date Start date
D

Doogie

What is the difference between this:

HttpContext.Current.Response

and this:

System.Web.HttpApplication.Response

I want to create a common method in a .vb file and cannot use
System.Web.HttpApplication.Response to do it. But I can use
HttpContext.Current.Response and wanted to know what the difference is
(if any) just to make sure I am not creating a problem for myself by
doing it that way.
 
HttpContext.Current.Response provides you with a reference to the CURRENT
Response object for the actual page that is being processed.
Peter
 
So it sounds like it is not a good idea to use .vb files when dealing
with the Response object? I would like to have a method that creates
a cookie (there's several lines of code to get the data for this
cookie) and I need to have this method accessible by one of my pages
as well as the global.aspx.vb file (cause I want to create the cookie
upon startup, but also have the ability to recreate it if needed
within another page). I'm not going to have a way to use a Response
object that both have access to within this .vb file am I?
 
Back
Top