Marko
Marko

Reputation: 5552

Programatically set HttpContext.Handler in classic ASP.NET application

In my CMS application, I'm trying to intercept all ASP.NET requests, inspect them and then assign custom HttpHandler if necessary or leave default handling when appropriate. I tried setting HttpContext.Current.Handler in Application_BeginRequest but it doesn't seem to work. There is MapRequestHandler event in HttpApplication but it is not available in the Global application class.

Any ideas?

Upvotes: 1

Views: 513

Answers (1)

David
David

Reputation: 34563

You should probably use an HttpModule for this instead of the Global.asax.

Upvotes: 1

Related Questions