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 Web application

When using Active Server Pages, 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
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:

1) Running Apps 1 2) Running Apps 2 3) Running Apps 3 4) Running Apps 4 5) Running Apps 5 6) Running Apps 6 7) Running Apps 7

Program 1 Program 2 Program 3 Program 4 Program 5 Program 6 Program 7
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.

Ad ASP.NET Core 5