Building WebApps  «Prev  Next»

Lesson 2Running a Web application
ObjectiveDescribe the setup and operation of a Web application

Setup and Operation of ASP Web Application

One of the critical differences between typical standalone applications and a Web application is the HTTP's lack of state. In the last module, we discussed how you could use the Session object to keep track of information for a specific user and maintain state.
ASP also includes an Application object that enables you to track variables and share information among all the users who are using the same application at the same time. Still, when users are constantly requesting and receiving Web pages, but often not talking to the server, how do you define "application" in this context?

Setting up directories for a Web application

With ASP, an application is defined as all of the .asp and .html files in a virtual directory and its subdirectories. The following diagram illustrates one possible organization for the T-Mania Web site and highlights its catalog ASP application.

Diagram of ASP web application; Application Root with subdirectories.

Starting and running a Web application

In addition to organizing the various elements of your Web site, using multiple subdirectories allows you to assign a higher level of security to directories containing user data and administrative files.
Through ASP, you can start and initialize a Web application when the first user accesses it. Any activities that have to occur before the application is run, such as writing to a log file or opening a database, can be performed through the Global.asa file that you learned about in the module on session management.
The following SlideShow illustrates how ASP manages an application and its multiple users:


Running Managing Applications
You already know how to set up special procedures in the Global.asa file that are run whenever users begin and end their sessions. Now you will learn how to set up similar procedures for applications. The next lesson will explain how to specify application start and end procedures.