|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
Listing 33.4 Using the ASP Objects <%@ LANGUAGE=VBSCRIPT %> <% Session(User_ID) = Request.Form(User_Id) %> <% Session(nba_Online)= Request.Form(nba_online) %> <% Session(nfl_Online)= Request.Form(nfl_online) %> <% If IsEmpty(Session(User_Id)) Then Response.Redirect invalid.htm Else If Request.Form(report_type)=nba Then If Session(nba_Online)=Y Then Response.Redirect latest_nba.htm Else Response.Redirect invalid.htm End If Else If Session(nfl_Online)=Y Then Response.Redirect latest_nfl.htm Else Response.Redirect invalid.htm End If End If End If %> Note that no HTML is in this file. Thats because all output sent to the browser is handled through the redirects, not by dynamically writing out any HTML. Active Server Page ObjectsFive fundamental server objects typically form the core of ASP applications:
Like any other object within an object-oriented programming world, the five ASP objects have specific events, methods, and properties. You can use an ASP objects events, methods, and properties to configure the object per your application and business requirements. You will learn more about the methods and properties of ASP objects in the following sections. These five ASP objects are extremely critical for developing an ASP application. The Application ObjectBy using the Application object, you can manage your Web applications information. You can pass application-level information between different users of the application. In addition, you can lock and unlock an application-level variable. When you lock an application-level variable, users of the application cannot modify the variables value. After you release the lock, users can modify the variables value. Events The Application object supports the following two events:
You will find the Application objects two events within your applications global.asa file.
Variables You declare application-level variables within your applications global.asa file. The following line of code, for example, declares an application-level variable myAppTitle. After you declare the variable, all users of the application will have access to the variable Application(myAppTitle)=My First ASP application In the next section, you will learn how you can use the Application objects Lock and UnLock methods with your application-level variables. Methods Two primary types of methods are used in the Application object:
The Session ObjectBy using the Session object, you can manage information about a specific user of your Web application. The user information is specific only to the user, and one user cannot access or modify another users information. The Session object includes the events, properties, and methods described in the following sections.
Events Like the Application object, the Session object also supports the following two events:
You will find the Session objects two events within your applications global.asa file.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |