Appication level event handlers in global.asax : Global.asax « ASP.Net Instroduction « ASP.NET Tutorial

ASP.NET Tutorial
1. ASP.Net Instroduction
2. Language Basics
3. ASP.net Controls
4. HTML Controls
5. Page Lifecycle
6. Response
7. Collections
8. Validation
9. Development
10. File Directory
11. Sessions
12. Cookie
13. Cache
14. Custom Controls
15. Profile
16. Configuration
17. LINQ
18. ADO.net Database
19. Data Binding
20. Ajax
21. Authentication Authorization
22. I18N
23. Mobile
24. WebPart
25. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
ASP.NET Tutorial » ASP.Net Instroduction » Global.asax 
1. 6. 4. Appication level event handlers in global.asax
<script language="VB" runat="server">

   Sub Application_Start(Sender as Object, e as EventArgs)
      Application("Time"= System.DateTime.Now
   End Sub

   Sub Application_AcquireRequestState(Sender as Object, e as EventArgs)
      Response.Write("Acquiring request session state" "...<br>")
   End Sub

   Sub Application_AuthenticateRequest(Sender as Object, e as EventArgs)
      Response.Write("Authenticating request...<br>")
   End Sub

   Sub Application_AuthorizeRequest(Sender as Object, e as EventArgs)
      Response.Write("Authorizing request...<br>")
   End Sub

   Sub Application_PostRequestHandlerExecute(Sender as Object, e as EventArgs)
      Response.Write("Request handler executed...<br>")
   End Sub

   Sub Application_PreRequestHandlerExecute(Sender as Object, e as EventArgs)
      Response.Write("Request handler executed...<br>")
   End Sub

   Sub Application_PreSendRequestContent(Sender as Object, e as EventArgs)
      Response.Write("Receiving request content...<br>")
   End Sub

   Sub Application_PreSendRequestHeaders(Sender as Object, e as EventArgs)
      Response.Write("Receiving request headers...<br>")
   End Sub

   Sub Application_ReleaseRequestState(Sender as Object, e as EventArgs)
      Response.Write("Releasing request state...<br>")
   End Sub

   Sub Application_ResolveRequestCache(Sender as Object, e as EventArgs)
      Response.Write("Resolving request cache...<br>")
   End Sub

   Sub Application_UpdateRequestCache(Sender as Object, e as EventArgs)
      Response.Write("Updating request cache...<br>")
   End Sub

   Sub Application_Error(Sender as Object, e as EventArgs)
      Response.Write(Sender.Request.isAuthenticated & " is authenticating request...<br>")
   End Sub

   Sub Session_Start(Sender as Object, e as EventArgs)
      Response.Write("Session is starting...<br>")
   End Sub

   Sub Application_BeginRequest(Sender as Object, e as EventArgs)
      Response.Write("<b>Process</b>")
      Response.Write("Request is starting...<br>")
   End Sub

   Sub Application_EndRequest(Sender as Object, e as EventArgs)
      Response.Write("Request is ending...<br>")
   End Sub

</script>
1. 6. Global.asax
1. 6. 1. The global.asax Application File
1. 6. 2. Some events don't fire with every request:
1. 6. 3. Global application file. (C#)
1. 6. 4. Appication level event handlers in global.asax
1. 6. 5. Global.asax file can be used to track the number of page requests made for any page.
1. 6. 6. Application level action sequence
1. 6. 7. Static application variables
1. 6. 8. Override string GetVaryByCustomString in Global.asax (C#)
1. 6. 9. Override string GetVaryByCustomString in Global.asax (VB)
1. 6. 10. Log exception in Global.asax (C#)
1. 6. 11. Log exception in Global.asax (VB)
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.