468,133 Members | 1,475 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

HttpContext Response vs. HttpApplication Response

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.

Apr 27 '07 #1
2 4374
HttpContext.Current.Response provides you with a reference to the CURRENT
Response object for the actual page that is being processed.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Doogie" wrote:
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.

Apr 27 '07 #2
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?
Apr 27 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Mark Overstreet | last post: by
5 posts views Thread by Paul de Goede | last post: by
2 posts views Thread by Luis Esteban Valencia Muñoz | last post: by
1 post views Thread by phil2phil | last post: by
15 posts views Thread by James Higgs | last post: by
2 posts views Thread by Rein Petersen | last post: by
reply views Thread by Aaron Morton | last post: by
6 posts views Thread by =?Utf-8?B?Q2h1Y2sgUA==?= | last post: by
27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.