@ Application directive in global.asax

  • Thread starter Thread starter Marek
  • Start date Start date
M

Marek

Hi,

Global.asax can be configured to use code-behind class. In order to do that
"Implements" attribute has to be declared within @Application directive. I
have read that the base class (derived form HttpApplication) to inherit from
must be precomiled and stored in the \bin folder of the application. That
works fine. I have noticed, however, that @Application accepts also "Src"
attribute as the regular @Page directive does. In this case "Src" attribute
points to the source file of the base class. This also works fine.
My question is if "Src" attribute can be legally used or it is just an
undocumented feature of the @Application directive.

Marek.
 
Hi,

Src attribute is part of the mechanism that ASP.NET uses to dynamically
create classes from ASPX declarations. src point to the class that the
programmer implemented. You can read my article on Code project:
www.codeproject.com/aspnet/ASPXFILES.asp

The same apply to Global.asax.

From MSDN : "RAD designers, such as Visual Studio .NET, do not use this
attribute. Instead, they precompiled code-behind classes and then use
the Inherits attribute."


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top