How should a custom Global.asax look in a custom project? I tried something like this:
public class Global : HttpApplication
{
public void Application_AuthenticateRequest(object sender, EventArgs e)
{
GlobalAsaxHandler.Application_AuthenticateRequest(sender, e);
}
...
}
However, that either crashes in Application_Start of the Dynamicweb Start handler with a null reference exception or I end up in an endless loop. Could it be that I am missing the checks for the Preloader and/or the code that sets up the context?
I hacked my way around it with the following:
public class Global : Dynamicweb.Admin.Global
{
public void Session_Start(object sender, EventArgs e)
{
GlobalAsaxHandler.Session_Start(sender, e);
// My stuff on Session_Start here
}
}
This works and runs my custom Global code but it feels a bit wrong as I am "new-ing" Session_Start.
Is there a best practice?
Thanks,
Imar