ASP The Global.asa file Y.-H. Chen International College Ming-Chuan University Fall, 2004.

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

Maintaining State Between the Client and Server Internet Programming Using VBScript and JavaScript 9.
MWD1001 Website Production Using JavaScript with Forms.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
The Web Warrior Guide to Web Design Technologies
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
1 Chapter 12 Working With Access 2000 on the Internet.
Introduction to Active Server Pages
Multiple Tiers in Action
Active Server Pages Chapter 1. Introduction Understand how browsers and servers interacted when the Web was young Understand what early Internet and intranet.
Server-Side Scripting with ASP.Net ISYS 546. ASP.NET ASP.NET is a server-side technology for creating dynamic web pages. ASP.NET allows you to use a selection.
Client State Management & Application Security  Client State Management  Concept  ASP Examples  Application Security  Database Based Approach 
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Active Server Pages Points of Interest Chapters 1-4.
ASP Cookies Y.-H. Chen International College Ming-Chuan University Fall, 2004.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
Chapter 5 Java Script And Forms JavaScript, Third Edition.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
CIS 375—Web App Dev II ASP II. 2 ASP Session: Introduction The Session _______ is used to store information about, or change settings for a user session.
Elements of ASP Documents Adapted from MCDN Web Workshop ( and Webmonkey’s Introduction to Active.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
ASP Introduction Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Chapter 8 Cookies And Security JavaScript, Third Edition.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Cookies Web Browser and Server use HTTP protocol to communicate and HTTP is a stateless protocol. But for a commercial website it is required to maintain.
1 Chapter 9 – Cookies, Sessions, FTP, and More spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
Swiss Federal Institute of Technology 1 Active Server Pages (ASP) n The simplest example: Additionally ASP may contain code (scripts, ActiveX controls)
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
Lecture Note 8: ASP Including Files and The Global.asa file.
Lecture Note 7: Sessions and Applications Object.
PHP Error Handling & Reporting. Error Handling Never allow a default error message or error number returned by the mysql_error() and mysql_errno() functions.
ASP (COMPONENTS) Active Server Pages (cont..) 1. global.asa file The Global.asa file is an optional file that can contain declarations of objects, variables,
Form Processing Week Four. Form Processing Concepts The principal tool used to process Web forms stored on UNIX servers is a CGI (Common Gateway Interface)
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
HTML FORMS The TEXT Object Presented By: Ankit Gupta.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
Maintaining State in ASP. Problem - How do I maintain state information about the user  Several Methods –Cookies –Session variables –Hidden fields 
Application Object Controlling the Application Application Object Controlling the Application.
ASP Application Object Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Active Server Pages Session - 3. Response Request ApplicationObjectContext Server Session Error ASP Objects.
ASP Syntax Y.-H. Chen International College Ming-Chuan University Fall, 2004.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
Beginning JavaScript 4 th Edition. Chapter 1 Introduction to JavaScript and the Web.
Folkert Klemme, Data Access Corporation Active Server Pages & VB Script The Basics for the.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Active Server Pages v.s. Java Server Pages Presenters: Lan Guo Qunying Fan Pei-Xun Wu Date:
ASP Mr. Baha & Dr.Husam Osta  What is ASP?  Internet Information Services  How Does ASP Differ from HTML?  What can ASP do for you?  ASP Basic.
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
Department of Computer Science
Y.-H. Chen International College Ming-Chuan University Fall, 2004
ASP Explained By: Sarbjit Kaur.
Active Server Pages Computer Science 40S.
Introduction to ASP By “FlyingBono” 2009_01 By FlyingBono 2009_01
Section 17.1 Section 17.2 Add an audio file using HTML
JavaScript Introduction
ASP.
Tutorial 10: Programming with javascript
Cookies A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer.
Presentation transcript:

ASP The Global.asa file Y.-H. Chen International College Ming-Chuan University Fall, 2004

2 The Global.asa file The Global.asa file is an optional file that can contain declarations of objects, variables, and methods that can be accessed by every page in an ASP application. All valid browser scripts (JavaScript, VBScript, JScript, PerlScript, etc.) can be used within Global.asa. The Global.asa file can contain only the following:  Application events  Session events  declarations  TypeLibrary declarations  the #include directive Note: The Global.asa file must be stored in the root directory of the ASP application, and each application can only have one Global.asa file.

3 Events in Global.asa In Global.asa you can tell the application and session objects what to do when the application/session starts and what to do when the application/session ends. The code for this is placed in event handlers. The Global.asa file can contain four types of events:  Application_OnStart - This event occurs when the FIRST user calls the first page from an ASP application. This event occurs after the Web server is restarted or after the Global.asa file is edited. The "Session_OnStart" event occurs immediately after this event.  Session_OnStart - This event occurs EVERY time a NEW user requests his or her first page in the ASP application.  Session_OnEnd - This event occurs EVERY time a user ends a session. A user ends a session after a page has not been requested by the user for a specified time (by default this is 20 minutes).  Application_OnEnd - This event occurs after the LAST user has ended the session. Typically, this event occurs when a Web server stops. This procedure is used to clean up settings after the Application stops, like delete records or write information to text files.

4 Events in Global.asa

5 How to use the Subroutines

6

7

8 Global.asa Example In this example we will create a Global.asa file that counts the number of current visitors.  The Application_OnStart sets the Application variable "visitors" to 0 when the server starts  The Session_OnStart subroutine adds one to the variable "visitors" every time a new visitor arrives  The Session_OnEnd subroutine subtracts one from "visitors" each time this subroutine is triggered

9 Global.asa Example

10 Global.asa Example