I configured AR according to the online docs, specifically:
public void Application_Start(Object sender, EventArgs e)
{
BeginRequest += new EventHandler(OnBeginRequest);
EndRequest += new EventHandler(OnEndRequest);
}
However this didn't work which was surprising so I set some
breakpoints in my global application and observed the following events
in cronological order:
1) Constructor, OnStart
2) Constructor, OnBeginRequest (x1)
3) Constructor, OnBeginRequest (x13)
So 3 instances of the global application were created and the
OnBeginRequest events were sent to a different instance than the
OnStart events which explains why it didn't work. As soon as I changed
the code as follows everything started working:
public GlobalApplication()
{
BeginRequest += new EventHandler(OnBeginRequest);
EndRequest += new EventHandler(OnEndRequest);
}
But this does strike me as a very strange thing to be happening - any
ideas?
Cheers,
Dale
I usually hook the events by overriding the HttpApplication.Init
method. It's called once per Application instance, just like the
constructor... But it's called after all modules were created, so I
guess it's safer to work there.
--
Fábio David Batista
fabio.dav...@gmail.com
http://nerd-o-matic.blogspot.com
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.485 / Virus Database: 269.13.14/999 - Release Date: 10/09/2007
17:43
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.485 / Virus Database: 269.13.14/999 - Release Date: 10/09/2007
17:43