Application Object Controlling the Application Application Object Controlling the Application.

Slides:



Advertisements
Similar presentations
E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2.
Advertisements

Java Script Session1 INTRODUCTION.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Web-based Programming Lanjut Pertemuan 2 Matakuliah: M0492 / Web-based Programming Lanjut Tahun: 2007.
1 Chapter 12 Working With Access 2000 on the Internet.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
CSE 190: Internet E-Commerce Exam 2 Sample Questions.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
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.
 2004 Tau Yenny, SI - Binus M0194 Web-based Programming Lanjut Session 2.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
IT533 Lectures Configuring, Deploying, Tracing and Error Handling.
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.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Using Visual Basic 6.0 to Create Web-Based Database Applications
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.
Session 10: Managing State. Overview State Management Types of State Management Server-Side State Management Client-Side State Management The Global.asax.
Elements of ASP Documents Adapted from MCDN Web Workshop ( and Webmonkey’s Introduction to Active.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
ASP The Global.asa file Y.-H. Chen International College Ming-Chuan University Fall, 2004.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Tracing 1www.tech.findforinfo.com. Contents Why Tracing Why Tracing Tracing in ASP.NET Tracing in ASP.NET Page Level tracing Page Level tracing Application.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
 2001 Prentice Hall, Inc. All rights reserved. Chapter 15 – Case Study: Message Forum with Active Server Pages Outline 15.1Introduction 15.2Setup and.
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Department of Computer Science 1 Web/Database Integration with Active Server Pages 17 May 2000 Seree Chinodom Computer Science Department.
JSTL Lec Umair©2006, All rights reserved JSTL (ni) Acronym of  JavaServer Pages Standard Tag Library JSTL (like JSP) is a specification, not an.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
JSP Fundamentals Elements of a JSP Using Beans with JSP Integrating Servlets and JSP.
Where does PHP code get executed?. Where does JavaScript get executed?
37 Copyright © 2007, Oracle. All rights reserved. Module 37: Executing Workflow Processes Siebel 8.0 Essentials.
Christopher M. Pascucci.NET Programming CodeBehind.
8 th Semester, Batch 2008 Department Of Computer Science SSUET.
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.
Lecture Note 8: ASP Including Files and The Global.asa file.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Lecture Note 7: Sessions and Applications Object.
1 Web/Database Integration with Active Server Pages 15th/16th October 1998 Nick Gould Faculty of Economic and Social.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
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,
Building Applications using ASP.NET and C# / Session 5 / 1 of 19 Session 5.
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
Maintaining State in ASP. Problem - How do I maintain state information about the user  Several Methods –Cookies –Session variables –Hidden fields 
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.
Raina NEC Application Object Describes the methods, properties, and collections of the object that stores information related to the entire Web.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Active Server Pages v.s. Java Server Pages Presenters: Lan Guo Qunying Fan Pei-Xun Wu Date:
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
Y.-H. Chen International College Ming-Chuan University Fall, 2004
ASP Explained By: Sarbjit Kaur.
Using local variable without initialization is an error.
PL/SQL Scripting in Oracle:
ASP.
PHP: Hypertext Preprocessor
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:

Application Object Controlling the Application Application Object Controlling the Application

Application Object Application Object is created to represent an instance of an ASP application. Application Object is the fundamental object that is used to start and manage ASP applications. Application Object is a single object that can accessed by any user of that application

Application Object Information can be shared to all users in the application Session Objects,The individual users, represented by Session Objects, can read and update the application object as needed. The application object is controlled in the GLOBAL.ASA file

Application Object

The Application object as well as the other ASP objects, follows the familiar Object.method Application.method

Application Object The application objects have two events –Application_OnStart : Initiated when the ASP application is first started. –Application_OnEnd : Initiated when the ASP application is terminated.

Declaring Application-Level Variables Application Object-level variables are accessible by all user ov an application and share information common to all users. Application-level variables can be defined as needed in any ASP file, not just in the Application_OnStart and Application_OnEnd events of the GLOBAL.ASA file.

Scope of Variables in ASP Variables have two level of scope in ASP. –Page-level variables : are defined by a scripting language within an ASP scripts, and only has scope as that page is being processed. –object-level variables : exists in two forms session level : are used to pass variables from page to page fot a specifis user application level : are used to share commom information between all users.

Declaring Variables To declare a variable, use the following syntax: ObjectLevel(VarName) where ObjectLevel is the Application or Session Object and VarName is the name of the variable Example Application(“myAppWelcomeStr”) = “Welcome”

Example 1 : Global.asa Declaring an application-level to set a welcome message for all users in the application Sub Application_OnStart Application(“myWelcomeStr”)=“Welcome to my Homepage” Application(“myTitle”)=“ASP Corporation.” End Sub

Example 1 : ASP file

Example 2 : Global.asa Sub Application_OnStart Application(“counter”)= 1 End Sub Sub Session_OnStart Dim userCounter userCounter = Application(“counter”) + 1 Application(“counter”) = userCounter End Sub

Application_OnStart Event The Application_OnStart event is executed before any user or session event is trigged. So, any attempt to call a Session, Response, or Request object will be generate a fatal runtime error. Sub Application_OnStart …….Your application initialization code here End Sub

Application_OnEnd event The Application_OnEnd event occurs when the Web server terminates the Application. Sub Application_OnEnd …….Your script here. End Sub

Controlling Application-Level variable with Method The Application object has two methods to control variable access. –Lock : Prevent other users from changing Application object properties. –UnLock : Enables other users to modify the Application object properties.

Example 3 : Lock, UnLock Method <% Application.Lock Application(“vDueDate”)=Request.Form(“txtDueDate”) Application.UnLock %> This Application was processed on

UnLock Method Unlock is called when : –the page was finished processing –The script processing for a page times out (specific by session object)

Using Array at the Application Level Good way of storing information and making it available to all pages in your ASP application. Because this is static information, populating and array once from database conserves resources and processing power and saves you from having to make a database call for request.

Example 4 : Array in Global.asa Sub Application_OnStart Dim aMyAppTraining(4) aMyAppTraining(1) = “Using Active Server Pages” aMyAppTraining(2) = “Internet Architecture : The Basics” aMyAppTraining(3) = “Content management” aMyAppTraining(4) = “Internet Application workflow” Application(“aTraining”) = aMyAppTraining End Sub

Example 4 : Any ASP file (index.asp) <% Dim aLocalTrainingArray aLocalTrainingArray = Application(“aTraining”) aLocalTrainingArray(4) = “MY New Class” iClass = Ubound(aLocalTrainingArray) For i = 1 to iClass Response.Write(aLocalTrainingArray(i) & “ ”) Next %>

Example 4 : Result