473,320 Members | 2,083 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,320 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 5006
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.