0

Is it possible to create my own Global.asax from codebehind?

I want to be able to edit void RegisterRoutes(RouteCollection routes) without the Global.asax file

Is this possible? If so, how?

Jon Egerton
  • 40,401
  • 11
  • 97
  • 129
midnightsyntax
  • 409
  • 4
  • 15

1 Answers1

0

To answer your question, you cannot programatically declare the HttpApplication class represented by Global.asax. Global.asax represents the HttpApplication itself, and so it is technically already created (whether you create a Global.asax yourself or not). You can use an HttpModule to achieve your objective.

Ethan Cabiac
  • 4,943
  • 20
  • 36