Confusion about the HttpContext

  • Thread starter Thread starter coollzh
  • Start date Start date
C

coollzh

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.....
 
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)
 
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 .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top