Tutorials » AspNet tutorials »

What is Global.asax file?

This chapter explains the purpose of global.asax file

Every web application created in VS.NET creates a file called 'global.asax' and 2 related files called 'global.asax' and

'global.asax.resx'. The files global.asax is a replacement for the global.asa file used in classic ASP.

Global.asax.vb is the code behind file for he global.asax. This file is used to handle global events in the web application.

You must be already familiar with event handling in ASP.NET. If a page level event happens, it can be handled in code

behind file of the corresponding page. But there are couple of events which are not specific to any page. These events are applicable to the entire application. Global.asax and the code behind file global.asax.vb are used to handle such global events.

When VS.NET creates the global.asax file, it creates these event handlers without any code in it. If you want to handle any of these events, you just need to insert your code to appropriate event handler.

Next Chapter: Global events in ASP.NET
Previous Chapter: Web.config for Web applications
More Chapters: ASP.NET Tutorials
More Tutorials: Tutorial Index

Top Contributors
    Last 7 Daysmore...

    Awards & Gifts
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India