OVERVIEW OF ASP. What is ASP. Why ASP



Similar documents
Web Pages. Static Web Pages SHTML

Introduction to ASP. Are you sick of static HTML pages? Do you want to create dynamic web pages? Do you

Web Hosting Features. Small Office Premium. Small Office. Basic Premium. Enterprise. Basic. General

Last update: February 23, 2004

Lecture 2. Internet: who talks with whom?

Portals and Hosted Files

Windows Hosting Documentation

WEB DATABASE PUBLISHING

Chapter 1 Programming Languages for Web Applications

BarTender Integration Methods. Integrating BarTender s Printing and Design Functionality with Your Custom Application WHITE PAPER


reference: HTTP: The Definitive Guide by David Gourley and Brian Totty (O Reilly, 2002)

4D as a Web Application Platform

How To Understand The History Of The Web (Web)

Search help. More on Office.com: images templates

How To Test Your Web Site On Wapt On A Pc Or Mac Or Mac (Or Mac) On A Mac Or Ipad Or Ipa (Or Ipa) On Pc Or Ipam (Or Pc Or Pc) On An Ip

1. When will an IP process drop a datagram? 2. When will an IP process fragment a datagram? 3. When will a TCP process drop a segment?

Xtreeme Search Engine Studio Help Xtreeme

LabVIEW Internet Toolkit User Guide

SaskTel Web Hosting Feature Overview

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Equipment Room Database and Web-Based Inventory Management

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

DEPLOYMENT GUIDE Version 2.1. Deploying F5 with Microsoft SharePoint 2010

Software Requirement Specification For Flea Market System

Internet Information TE Services 5.0. Training Division, NIC New Delhi

WWW. World Wide Web Aka The Internet. dr. C. P. J. Koymans. Informatics Institute Universiteit van Amsterdam. November 30, 2007

Agenda. Summary of Previous Session. Application Servers G Session 3 - Main Theme Page-Based Application Servers (Part II)

1 How to Monitor Performance

10. Java Servelet. Introduction

Gateway Apps - Security Summary SECURITY SUMMARY

VB.NET - WEB PROGRAMMING

Internet Technologies_1. Doc. Ing. František Huňka, CSc.

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Oracle Forms Services Secure Web.Show_Document() calls to Oracle Reports Server 6i

Lecture 11 Web Application Security (part 1)

Dreamweaver CS3 THE MISSING MANUAL. David Sawyer McFarland. POGUE PRESS" O'REILLY 8 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

DEPLOYMENT GUIDE. Deploying F5 for High Availability and Scalability of Microsoft Dynamics 4.0

ACM Crossroads Student Magazine The ACM's First Electronic Publication

understand how image maps can enhance a design and make a site more interactive know how to create an image map easily with Dreamweaver

How To Create A Database Driven Website On A Computer Or Server Without A Database (Iis) Or A Password (Ict) On A Server (Iip) Or Password (Web) On An Anonymous Guestbook (Iit) On Your

4 Understanding. Web Applications IN THIS CHAPTER. 4.1 Understand Web page development. 4.2 Understand Microsoft ASP.NET Web application development

MXSAVE XMLRPC Web Service Guide. Last Revision: 6/14/2012

Chapter 27 Hypertext Transfer Protocol

Oracle Forms Services Secure Web.Show_Document() calls to Oracle Reports

A send-a-friend application with ASP Smart Mailer

Introduction to the. Barracuda Embedded Web-Server

A Java proxy for MS SQL Server Reporting Services

4.2 Understand Microsoft ASP.NET Web Application Development

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP System v10 with Microsoft IIS 7.0 and 7.5

DEPLOYMENT GUIDE Version 1.2. Deploying F5 with Oracle E-Business Suite 12

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

PDG Software. Site Design Guide

StreamServe Persuasion SP4 StreamServe Connect for SAP - Business Processes

Chapter 10: Multimedia and the Web

XML Processing and Web Services. Chapter 17

Tenrox. Single Sign-On (SSO) Setup Guide. January, Tenrox. All rights reserved.

Designing and Implementing Forms 34

Understanding Application Servers

Load testing with. WAPT Cloud. Quick Start Guide

Testing Web Applications for SQL Injection Sam Shober

Building a Multi-Threaded Web Server

Cache Configuration Reference

Building a Database-Driven Web Application With FileMaker

Basic Website Creation. General Information about Websites

Figure 9-1: General Application Security Issues. Application Security: Electronic Commerce and . Chapter 9

MCTS Self-Paced Training Kit (Exam ): Configuring Windows Server 2008 Application Platform

Advanced Web Application Development using Microsoft ASP.NET

End User Guide The guide for /ftp account owner

APACHE WEB SERVER. Andri Mirzal, PhD N

Perl/CGI. CS 299 Web Programming and Design

JAVASCRIPT AND COOKIES

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP System v9.x with Microsoft IIS 7.0 and 7.5

Developing and Implementing Web Applications with Microsoft Visual C#.NET and Microsoft Visual Studio.NET

2311A: Advanced Web Application Development using Microsoft ASP.NET Course 2311A Three days Instructor-led

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

Microsoft Visual Basic Scripting Edition and Microsoft Windows Script Host Essentials

1 How to Monitor Performance

How-to: Single Sign-On

MCTS Self-Paced Training Kit (Exam ): Configuring Windows Server 2008 Application Platform

CGI An Example. CGI Model (Pieces)

Guide to Analyzing Feedback from Web Trends

Configuring Microsoft IIS 5.0 With Pramati Server

Fig (1) (a) Server-side scripting with PHP. (b) Client-side scripting with JavaScript.

multiple placeholders bound to one definition, 158 page approval not match author/editor rights, 157 problems with, 156 troubleshooting,

User Guide to the Content Analysis Tool

PHP COOKIES, SESSIONS,

COMP 112 Assignment 1: HTTP Servers

What is Web Security? Motivation

Rational Software White Paper

J j enterpririse. Oracle Application Express 3. Develop Native Oracle database-centric web applications quickly and easily with Oracle APEX

Bring the power and speed of RAD to your Web application development with WebSnap

ERIE COMMUNITY COLLEGE COURSE OUTLINE A. COURSE TITLE: CS WEB DEVELOPMENT AND PROGRAMMING FUNDAMENTALS

Transcription:

OVERVIEW OF ASP What is ASP Active Server Pages (ASP), Microsoft respond to the Internet/E-Commerce fever, was designed specifically to simplify the process of developing dynamic Web applications. Built into Internet Information Server (IIS)Version 3.0 and later, ASP provides an easy-to-learn scripting interface along with a number of predefined objects that simplify many development tasks such as maintaining user state and defining global variables within an application. You can also use ActiveX components to perform additional functions, among them accessing ODBC databases and outputting data to text files. ASP is similar in concept to Allaire's Cold Fusion and Netscape's server-side JavaScript, and it is designed as a convenient alternative to conventional CGI scripting using Perl or C scripts. It's a great fit for a wide array of workgroup applications, including online human resources and accounting applications. Active Server Pages is an open, compile-free application environment in which you can combine HTML, scripts, and reusable ActiveX server components to create dynamic and powerful Webbased business solutions. Active Server Pages enables server side scripting for IIS with native support for both VBScript and Jscript. Microsoft Corp. ASP is a server-side scripting technology that can be used to create dynamic and interactive Web applications. An ASP page is an HTML page that contains server-side scripts that are processed by the Web server before being sent to the user s browser. You can combine ASP with Extensible Markup Language (XML), Component Object Model (COM), and Hypertext Markup Language (HTML) to create powerful interactive Web sites [1]. Why ASP One of the well-known problems of traditional Web applications development is that the Web's underlying protocol, HTTP, and its markup language, HTML, weren't designed to handle complex application logic. Traditional HTML authoring tools, such as NetObjects Fusion and Macromedia Dreamweaver, are great for document publishing and simple Web sites, but they don't address the issue of server-side Web applications development. Table 1 summarizes the available scripting techniques and their features.

Table 1: Summary of Scripting Techniques Technology Simple Scripting Traditional CGI scripts lack built-in transaction and object orientation. Template-based Scripting HTML template files combined with application code written in a scripting language. This method provides transaction capabilities and simple object orientation. Application Servers Dedicated servers that handle application logic, usually written in C++ or Java. They provide sophisticated transaction capabilities and complex object models. Sample Products Fault Tolerance and Scalability Best fit CGI None Simple Web sites Allaire's Cold Fusion Microsoft s Active Server Pages (ASP) Netscape's serverside JavaScript NetDynamics Netscape s Application Server (Kiva) None Built-in fault tolerance and loadbalancing capabilities Workgroup applications High performance applications with complex business logic Unique Features of ASP ASP is a browser-independent technology. No matter which browser -- Internet Explorer, NCSA Mosaic, or Netscape Navigator -- visitors to your site are using, your ASP code generates HTML. ASP is designed to be language-independent; therefore, you can choose the language you want to use to write your server-side scripts. ASP is implemented as an ISAPI application integrated into IIS. As a result, ASP doesn't incur the performance overhead common to CGI applications, which spawn individual processes for every new request that goes through the Web server. With IIS 4.0, a single ISAPI process handles all ASP requests. Also, ASP can be run out-ofprocess from IIS, meaning that an ASP crash won't take the Web server down as well. With ASP, one can separate the design of your Web page from the nitty-gritty details of programming access to databases and applications. ASP runs as a service of the Web server and is optimized for multiple threads and multiple users.

What Can ASP Do ASP can be used to perform the following tasks: Store application variables. Retrieve browser request information. Handle dynamic and live data. E.g., Changes in pricing data were automatically reflected in the catalog's HTML pages. Uses ActiveX Data Objects (ADOs) to access data in ODBC-compliant databases such as Microsoft Access or SQL Server. Retrieve and modify data in text files on the server's file system (TextStream). Create instances of ActiveX objects. Examples of ASP Applications ASP can be used to design web page for many usages. Here are just a few selected examples of ASP applications. Put your employee handbook online, rather than printing copies that are soon obsolete. Employees can access and update their own records, such as address and health-plan benefits. Customers could update and manipulate selected data (e.g., shipping address and contact information). Tie online store to existing inventory database and order-processing system. Give every visitor to your site a personalized view of just the information he or she seeks, and automatically flag what is new since the last visit. How ASP Work When you create an ASP application, you create ASP script files: plain text files comprising a combination of standard HTML code and script commands. While Web servers normally send HTML files directly to the client's Web browser in response to HTTP requests, IIS first processes the content of ASP scripts before sending output to clients. Within an ASP script, standard HTML code is sent directly to the browser, while script commands are executed locally on the Web server. The diagram below shows the life cycle of an ASP page. We can break this life cycle into three distinct phases: the request, the processing, and the response. If you've used Common Gateway Interface (CGI), you'll find this very familiar. The request phase represents the initial point of contact between the user's Web browser and your ASP file. The user activates the ASP code by browsing into the file that contains your code (usually identifiable by its.asp filename extension). The first time a user visits your ASP application, IIS creates a Session object you can use to manage that user's context within your ASP application. If the user has already visited another ASP file in your ASP application (we'll see below what constitutes an ASP application), IIS will

update the state of the user's existing Session object. Once the Session object has been initialized, IIS begins executing the code in your ASP file. A user's Web browser can pass parameters to your ASP code through the file request command line. The arguments are processed by IIS and stored in a Request object that can be accessed by the code in the ASP page. For example, the HTTP GET request http://www.iunknown.com/story.asp?storyid=5 tells IIS there is a named argument called StoryID and its value is 5. The processing phase begins once IIS has initialized the Session and Request objects. IIS executes the ASP code and interacts with various databases or other ActiveX components according to your instructions. As IIS extracts and processes data from your ActiveX components, it can also generate the HTML page that will be sent back to the user's Web browser. After your ASP script finishes executing, the response phase begins. At this point, IIS again steps in to package the HTML page to ship back to the user's Web browser. Your page can contain anything that can be included in an HTML page. The one thing that it cannot contain, however, is live data. We will see later how Remote Data Service lets us solve this problem. Built-in Objects ASP includes five standard objects for global use: Request to get information from the user Response to send information to the user Server to control the Internet Information Server Session to store information about and change settings for the user's current Web-server session Application to share application-level information and control settings for the lifetime of the application

The Request and Response objects contain collections (bits of information that are accessed in the same way). Objects use methods to do some type of procedure and properties to store any of the object's attributes (such as color, font, or size). The Request object The Request object is used to get information from the user that is passed along in an HTTP request. It supports the following collections: ClientCertificate to get the certification fields from the request issued by the Web browser. The fields that you can request are specified in the X.509 standard. QueryString to get text such as a name, and favorite TV, et. Form to get data from an HTML form. Cookies to get the value of application-defined cookie. ServerVariables to get HTTP information such as the server name. The Response object The Response object is used to send information to the user. The Response object supports only Cookies as a collection (to set cookie values). The properties currently supported by Response object are: Buffer set to buffer page output at the server. When this is set to true, the server will not send a response until all of the server scripts on the current page have been processed, or until the Flush or End method has been called. ContentType to set the type of content (i.e: text/html, Excel, etc.). Expires sets the expiration (when the data in the user's cache for this Web page is considered invalid) based on minutes (i.e.: expires in 10 minutes). ExpiresAbsolute allows you to set the expiration date to an absolute date and time. Status returns the status line (defined in the HTTP specification for the server). The following methods are supported by the Response object: AddHeader Adds an HTML header with a specified value. AppendToLog Appends a string to the end of the Web server log file. BinaryWrite writes binary data (i.e, Excel spreadsheet data). Clear clears any buffered HTML output. End stops processing of the script. Flush sends all of the information in the buffer. Redirect to redirect the user to a different URL. Write to write into the HTML stream. This can be done by using the construct - Response.write("hello") or the shortcut command <%="hello"%> The Server object

The Server object supports one property, ScriptTimeout, which allows you to set the value for when the script processing will time out. It supports the following methods: CreateObject to create an instance of a server component. This component can be any component that you have installed on your server (such as an ActiveX ). HTMLEncode to encode the specified string in HTML. MapPath to map the current virtual path to a physical directory structure. You can then pass that path to a component that creates the specified directory or file on the server. URLEncode applies URL encoding to a specified string. The Session object The Session object is used to store information about the current user's Web-server session. Variables stored with this object exist as long as the user's session is active, even if more than one application is used. This object supports one method, Abandon, which (believe it or not!) abandons the current Web-server session, destroying any objects, and supports two properties, SessionID, containing the identifier for the current session, and Timeout, specifying a time-out value for the session. One thing to bear in mind about the session identifier: It's not a GUID. It's only good as long as the current Web-server session is running. If you shut down the Web-server service, the identifiers will start all over again. So don't use it to create logon IDs, or you'll have a bunch of duplicates and one heck of a headache. The Application object The Application object can store information that persists for the entire lifetime of an application (a group of pages with a common root). Generally, this is the whole time that the IIS server is running. This makes it a great place to store information that has to exist for more than one user (such as a page counter). The downside of this is that since this object isn't created anew for each user, errors that may not show up when the code is called once may show up when it is called 10,000 times in a row. In addition, because the Application object is shared by all the users, threading can be a nightmare to implement. References 1. Active Server Pages Tutorial, Microsoft Corporation. URL: http://msdn.microsoft.com/workshop/server/asp/asptutorial.asp 2. John Garris, Scripting with ASP. URL: http://www.zdnet.com/pcmag/pctech/content/17/12/nt1712.001.html 3. John Lam, Database Connectivity and the Internet: Active Server Pages and Remote Data Service. URL: http://www.zdnet.com/pcmag/pctech/content/16/22/it1622.001.html 4. ASP Today. URL: http://www.asptoday.com/ 5. Source Codes, WROX Publisher. URL: http://www.wrox.com/consumer/store/download.asp?category=consumer 6. Cluts, Nancy Winnick An ASP You Can Grasp: The ABCs of Active Server Pages. URL: http://msdn.microsoft.com/workshop/server/asp/aspover.asp

7. Wodaski, Ron, ASP Technology Feature Overview. URL http://msdn.microsoft.com/workshop/server/asp/aspfeat.asp 8. Cluts, Nancy Winnick, 25+ ASP Tips to Improve Performance and Style. URL: http://msdn.microsoft.com/workshop/server/asp/asptips.asp 9. Cluts, Nancy Winnick, ASP from A to Z. URL: http://msdn.microsoft.com/workshop/server/asp/aspatoz.asp 10. Moran, Tom, Ask Tom: Server Q & A. URL: http://msdn.microsoft.com/workshop/server/feature/morqa.asp