Thanks for your quick response CS,
Sorry for my carelessness, after some further research, I think the MSDN
document on the @ Application directive is correct:
#@ Application - Global.asax
http://msdn2.microsoft.com/en-us/library/es4ac4ek.aspx
So for using custom global class file for globa.asax file in ASP.NET 2.0
appliation, we have the following two options:
1. Just use the "Inherits" attribute to specify a base class , and this
class can exist in either a source file in App_Code dir or in a referenced
class library assembly. Just like the one in my last message, and the
"codebehind" attribute is optional, which is for compatibility to vs 2003
style codebehind.
2. If we want to use ASP.NET 2.0 style partial class codebeind file for
global.asax, we can just add a codebehind file which contains the partial
class, and then reference the partial class and codefile in @Application
directive, e.g:
#Note that the MyGlobal.cs file here is not put in App_Code, just put side
by side with global.asax file and will be dynamically compiled:
==========global.asax========
<%@ Application Language="C#" CodeFile="MyGlobal.cs" Inherits="MyGlobal"
%>
=======in MyGlobal.cs=========
public partial class MyGlobal : HttpApplication
{
...............
}
=====================
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)