Re: Events in HttpModule

From: John Haynes (john.haynes2.urhead_at_frumurass.acsalaska.net)
Date: 05/02/04


Date: Sun, 2 May 2004 11:15:35 -0700

Getting to the context or session is not the problem, the problem is they no
longer exist at that point in the HttpPipeline they've already been dumped
from the HttpContext...

They are null nothing do not exists at this point. In debug mode when ">?
HttpContext", Current, Session and a few other elements have already been
dumped. As simple as it may seem I have no access to those elements at that
point. At runtime it produces object not found errors

I'd like to find some actual documentation that details what happens when
the events in the pipeline get bypassed. For example. I was using
ReleaseRequestState but Response.Redirect never fires ReleaseRequestState
and goes right to the next page. Where AcquireRequesState will fire. On a
full page load I can run ReleaseRequestState and have full access to Context
and Session but the peculiar thing is PreSendRequestContent and
PreSendRequestHeader preceed ReleaseRequestState in the HttpPipeline yet I
dont have access to the Context or Session there. I have been unable to find
documentation that supports this.

Thanks for the info though.

John

"Natty Gur" <natty@dao2com.com> wrote in message
news:eVpMoYAMEHA.268@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> the source parameter holds HttpApplication so you can get context from
> it :
>
> public void Init(HttpApplication application)
> {
> application.BeginRequest += (new
> EventHandler(this.Application_BeginRequest));
> application.EndRequest += (new
> EventHandler(this.Application_EndRequest));
> application.PreSendRequestContent += (new EventHandler(this.App));
> }
>
> private void App(Object source, EventArgs e)
> {
> HttpApplication application = (HttpApplication)source;
> HttpContext context = application.Context;
> }
>
> anyway you can also use EndRequest.
>
> HTH
>
> Natty Gur[MVP]
>
> blog : http://weblogs.asp.net/ngur
> Mobile: +972-(0)58-888377
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: package session vars/ logins
    ... Say, for example, if I had a table of usernames, passwords, and ... Once the session ends their access to data ends too. ... what are some other realistic uses of package vars? ... CREATE CONTEXT in the docs.) ...
    (comp.databases.oracle.server)
  • Re: Create Outlook Contacts
    ... I identified the possible set methods to set named properties in the context ... Session session = new Session; ... //Set to display at Ms Outlook Contacts ...
    (microsoft.public.win32.programmer.messaging)
  • Re: HttpContext
    ... Made a wrapper to the session to use as the common store, and used configuration to tell them to use that particular wrapper/common storage? ... //Get context from session here ... public string ShortenUrl ... I am passing in the communicator as ICommunicator. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: package session vars/ logins
    ... userid of a current logged in user? ... Once the session ends their access to data ends too. ... CREATE CONTEXT in the docs.) ... only single authorized package or procedure ...
    (comp.databases.oracle.server)