asp.net 2.0 - Global.asax - Code Behind file - MSDN documentation
MSDN documentation appears to be wrong on code behind file for Global.asax. Documentation here
says that CodeFile
Specifies a path to the referenced code-behind file for the application class. This attribute is used together with the Inherits attribute to associate a code-behind source file with an application file.
However in VisualStudio.Net 2005 Global.asax won't allow you to have a 'CodeFile' attribute! If you try to add a partial class and try to specify it as the CodeFile attribute value, IDE throws the followin g compiler error.Validation (ASP.Net): Attribute 'CodeFile' is not a valid attribute of element 'Application'.
It appears that only way to have a global.asax.cs is to place that file in the App_Code directory and in the global.asax file just specify the Inherits attribute pointing to that class defined in the global.asax.cs.
Global.asax.cs in the app_code folder:
public class YourGlobalClass : HttpApplication
<%@ Application Language="C#" Inherits="YourGlobalClass" %>