@ Application directive in global.asax

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.
 
N

Natty Gur

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top