Re: Class Capability Differences
From: Jeff S (Jeff330ci_at_YaNopeSpamhoo.com)
Date: 03/26/04
- Next message: bruce barker: "Re: ASP.NET dynamic registration of COM+ library application question"
- Previous message: Bill Borg: "Turn off browser cache for particular image"
- In reply to: Kevin Spencer: "Re: Class Capability Differences"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 26 Mar 2004 10:36:06 -0800
Thanks for the great explanation. This explains a lot for me.
-Jeff
"Kevin Spencer" <kevin@takempis.com> wrote in message
news:%2394Ad11EEHA.628@TK2MSFTNGP10.phx.gbl...
> > Is it that code-behind modules inherit Page? Is there more to it?
>
> There is. The System.Web.UI.Page class is an HttpHandler; that is, it
> implements the IHttpHandler Interface, because its purpose is to handle
HTTP
> Requests. The HttpHandler is given the entire context in which the HTTP
> Request occurs (This is called the System.Web.HttpContext.Current object).
> The HttpContext contains the Request, Response, Session, Application, and
> other elements of the HttpContext of the current Request as Properties, in
> order to respond. The HttpContext of the current Request is therefore, a
> member by default of the Page class. In custom classes, you need to get a
> handle on the Current HttpContext (which will only occur in the context of
> an HttpRequest) in order to access these objects. This can be done by
> referring to the System.Web.HttpContext.Current object. Once you've done
> that, you can refer to the Application, for example, as
> System.Web.HttpContext.Current.Application.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
>
> "Jeff S" <Jeff330ci@YaNopeSpamhoo.com> wrote in message
> news:#Lxfo80EEHA.1128@TK2MSFTNGP11.phx.gbl...
> > Just wondering why some features are available from the code-behind
class
> > modules (.aspx.cs), and are not available from stand-alone class modules
> > (myClass.cs). For example, accessing the Application state is no problem
> > from a code-behind, but not from a stand-alone module in the same
> assembly.
> > Is it that code-behind modules inherit Page? Is there more to it?
> >
> > Thanks.
> >
> >
>
>
- Next message: bruce barker: "Re: ASP.NET dynamic registration of COM+ library application question"
- Previous message: Bill Borg: "Turn off browser cache for particular image"
- In reply to: Kevin Spencer: "Re: Class Capability Differences"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|