When to use Application_Start vs Init in Global.asax? When to use Application_Start vs Init in Global.asax? asp.net asp.net

When to use Application_Start vs Init in Global.asax?


From the MSDN docs:

The Application_Start and Application_End methods are special methods that do not represent HttpApplication events. ASP.NET calls them once for the lifetime of the application domain, not for each HttpApplication instance.

Init:

Called once for every instance of the HttpApplication class after all modules have been created.

UPDATE: if you need to make sure a certain code is called only once in the app. lifecycle, Application_Start is a better solution. Examples: configuring log4net?


Yes

There are differences between them. Application_Start() event is called just one time while Init() method is called on each time when instance of the application is created.