473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Confusion about the HttpContext

who can tell the detailed difference of:
HttpRuntime, Context, HttpContext.Current

sometimes, we can use Context Object instead of HttpContext.Current;
sometimes, we can user HttpRuntime Directly.....
Nov 18 '05 #1
5 5024
HttpRuntime class has several static methods for accessing information about
the AppDomain asp.net loaded to run the pages.

because asp.net is thread agile (the thread may change during processing of
a request) thread local storage can not be used to keep info on the running
request. HttpContext is used for this.

HttpContext.Current is a static method that returns the HttpContext
associated with the calling thread (may return null)
Page.Context is a reference set to same object as HttpContext.Current, but
is a direct reference, no internal lookup required.

-- bruce (sqlwork.com)

"coollzh" <co*****@hotmail.com> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
who can tell the detailed difference of:
HttpRuntime, Context, HttpContext.Current

sometimes, we can use Context Object instead of HttpContext.Current;
sometimes, we can user HttpRuntime Directly.....

Nov 18 '05 #2
nice
i like that explanation. good job

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"bruce barker" <no***********@safeco.com> wrote in message
news:O0*************@tk2msftngp13.phx.gbl...
HttpRuntime class has several static methods for accessing information about the AppDomain asp.net loaded to run the pages.

because asp.net is thread agile (the thread may change during processing of a request) thread local storage can not be used to keep info on the running request. HttpContext is used for this.

HttpContext.Current is a static method that returns the HttpContext
associated with the calling thread (may return null)
Page.Context is a reference set to same object as HttpContext.Current, but
is a direct reference, no internal lookup required.

-- bruce (sqlwork.com)

"coollzh" <co*****@hotmail.com> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
who can tell the detailed difference of:
HttpRuntime, Context, HttpContext.Current

sometimes, we can use Context Object instead of HttpContext.Current;
sometimes, we can user HttpRuntime Directly.....


Nov 18 '05 #3
HttpRuntime class has several static methods for accessing information about
the AppDomain asp.net loaded to run the pages.

because asp.net is thread agile (the thread may change during processing of
a request) thread local storage can not be used to keep info on the running
request. HttpContext is used for this.

HttpContext.Current is a static method that returns the HttpContext
associated with the calling thread (may return null)
Page.Context is a reference set to same object as HttpContext.Current, but
is a direct reference, no internal lookup required.

-- bruce (sqlwork.com)

"coollzh" <co*****@hotmail.com> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
who can tell the detailed difference of:
HttpRuntime, Context, HttpContext.Current

sometimes, we can use Context Object instead of HttpContext.Current;
sometimes, we can user HttpRuntime Directly.....

Nov 18 '05 #4
nice
i like that explanation. good job

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"bruce barker" <no***********@safeco.com> wrote in message
news:O0*************@tk2msftngp13.phx.gbl...
HttpRuntime class has several static methods for accessing information about the AppDomain asp.net loaded to run the pages.

because asp.net is thread agile (the thread may change during processing of a request) thread local storage can not be used to keep info on the running request. HttpContext is used for this.

HttpContext.Current is a static method that returns the HttpContext
associated with the calling thread (may return null)
Page.Context is a reference set to same object as HttpContext.Current, but
is a direct reference, no internal lookup required.

-- bruce (sqlwork.com)

"coollzh" <co*****@hotmail.com> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
who can tell the detailed difference of:
HttpRuntime, Context, HttpContext.Current

sometimes, we can use Context Object instead of HttpContext.Current;
sometimes, we can user HttpRuntime Directly.....


Nov 18 '05 #5
this is to say,the data from Context and the data from the
HttpContext.Current is the same one. in another words, the same value .

"bruce barker" <no***********@safeco.com> дÈëÏûÏ¢ÐÂÎÅ
:O0*************@tk2msftngp13.phx.gbl...
HttpRuntime class has several static methods for accessing information about the AppDomain asp.net loaded to run the pages.

because asp.net is thread agile (the thread may change during processing of a request) thread local storage can not be used to keep info on the running request. HttpContext is used for this.

HttpContext.Current is a static method that returns the HttpContext
associated with the calling thread (may return null)
Page.Context is a reference set to same object as HttpContext.Current, but
is a direct reference, no internal lookup required.

-- bruce (sqlwork.com)

"coollzh" <co*****@hotmail.com> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
who can tell the detailed difference of:
HttpRuntime, Context, HttpContext.Current

sometimes, we can use Context Object instead of HttpContext.Current;
sometimes, we can user HttpRuntime Directly.....


Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nayt Grochowski | last post by:
Does anyone see any problem with the loading a SqlConnection into the System.Web.HttpContextCurrent.Items collection in a Page's Constructor. Then Closing and Disposing of it the OnUnload method? ...
2
by: Alexander Inochkin | last post by:
Hi! Could you help me to understand next fact... I open in LDASM System.Web.dll and read: ..method /*060002D7*/ public hidebysig specialname static class System.Web.HttpContext/* 02000051...
0
by: John | last post by:
I'm trying to create a context object similar to the HttpContext that could be used by business objects independent of the origin or the call (ASP.NET or standalone). So I started out by...
3
by: coollzh | last post by:
who can tell the detailed difference of: HttpRuntime, Context, HttpContext.Current sometimes, we can use Context Object instead of HttpContext.Current; sometimes, we can user HttpRuntime...
3
by: Ken Varn | last post by:
I have Page1 that does a transfer to page2. When the user is done with Page2, there is a button on Page2 that they can press to bring them back to Page1. I use Server.Transfer to navigate from...
0
by: Aaron Morton | last post by:
I'm working on a IHttpModule that handles the PreSendRequestHeaders event from the HttpApplication, if the event is raised after EndRequest then HttpContext.Current is null. If it is raised before...
2
by: Dave | last post by:
After some digging, I discovered HttpContext.Current.Session is null when trying to access a session variable, username, in my upload.cs code which is in the App_Code folder. I just determined...
2
by: =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post by:
Hi, I'm using Threads, and when I try to do Server.Transfer, I recieved an error. (child object does not exist...) My Code: Dim t As New Thread(AddressOf Hilo) Private Sub Hilo()...
3
by: Madhur | last post by:
Hello I am delivering an asp.net 2.0 application to my customer. I need to know, If I need to check for the condition of HttpContext.Current to be null in my business logic. I have extensively...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.