Tài liệu Module 5: Using Server- Side Scripts pdf

52 441 0
Tài liệu Module 5: Using Server- Side Scripts pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Module 5: Using ServerSide Scripts Contents Overview Introduction to Active Server Pages (ASPs) Object Oriented Programming (OOP) Concepts Using ASP Objects Lab 5: Processing Form Data Using ServerSide Scripts 24 Programming in ASP 28 Review 48 Information in this document is subject to change without notice The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product, or event, unless otherwise noted Complying with all applicable copyright laws is the responsibility of the user No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation If, however, your only means of access is electronic, permission to print one copy is hereby granted Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property  2000 Microsoft Corporation All rights reserved Microsoft, ActiveX, BackOffice, FrontPage 2000, Internet Information Server, InterDev, JScript, MS-DOS, Notepad, PowerPoint, Visual Basic, Windows and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A and/or other countries The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product, or event, unless otherwise noted Other product and company names mentioned herein may be the trademarks of their respective owners Program Manager: Steve Merrill Development Lead: Basabjit Chakrabarty (NIIT) Instructional Designers: Sangeeta Nair, Vijayalakshmi Narayanaswamy (NIIT); Veena Nambier, Yatinder Walia (NIIT) Technical Contributors: Scott Swigart (3 Leaf Solutions); Gary Gumbiner (Great Barrier Technologies, Inc.) Graphic Artist: Scott Serna (Creative Assets) Editing Manager: Jennifer Linn Editor: Reid Bannecker Production Manager: Miracle Davis Production Coordinator: Linda Lu Cannon (The Write Stuff) Build Coordinator: Eric Wagoner Testing Lead: Eric Meyers Testing: Bryan Urakawa, Chris and Edward Lead Product Manager, Internet Services: Hilary Vandal Manufacturing Manager: Rick Terek Operations Coordinator: John Williams Manufacturing Support: Laura King; Kathy Hershey Lead Product Manager, Release Management: Bo Galford Group Manager, Courseware Infrastructure: David Bramble General Manager: Robert Stewart Module 5: Using Server-Side Scripts iii Instructor Notes Presentation: 165 Minutes Lab: 60 Minutes This module provides students with an overview of server-side scripts, such as Active Server Pages (ASPs) It also explains the concept of object oriented programming Students will also learn about the ASP object model and will learn to write programs using ASP At the end of this module, students will be able to: ! Execute ASP code in Microsoft IIS ! Use ASP objects to capture form information and handle server functions ! Use ASP to process form information ! Write server-side scripts using ASP Materials and Preparation This section provides you with the required materials and preparation tasks that are needed to teach this module Required Materials To teach this module, you need the following materials: ! Microsoft PowerPoint file 1912A_05.ppt ! Module 5, “Using Server-Side Scripts” ! Lab 5, “Processing Form Data Using Server-Side Scripts” Preparation Tasks To prepare for this module, you should: ! Read all of the materials for this module ! Complete the practices and lab in this module iv Module 5: Using Server-Side Scripts Module Strategy Use the following strategy to present this module: ! Introduction to Active Server Pages (ASPs) First, explain the working of ASPs Then, explain how to execute an ASP file using the Microsoft Internet Information Server (IIS) ! Object Oriented Programming (OOP) Concepts First, demonstrate and explain the sample code in Microsoft Internet Information Server Then, based on the demonstration, explain the concept of properties, and methods ! ASP Objects First, explain the Response object with the help of the example provided Then, explain the Request object with the help of the example provided Similarly, explain the Application, Session, and Server objects with the help of the examples provided Also, ask the students to practices based on the various ASP objects ! Programming in ASP This section introduces the concept of programming in context of serverside scripts Explain variables, data types, conditional statements, procedures, operators, and string functions with the help of the examples provided Finally, ask the students to practice based on the key concepts taught in this section Module 5: Using Server-Side Scripts # Overview Slide Objective To provide an overview of the module topics and objectives ! Introduction to Active Server Pages (ASPs) ! Object Oriented Programming (OOP) Concepts Lead-in ! Using ASP Objects ! Lab 5: Processing Form Data Using Server-Side Scripts ! Programming in ASP ! Review In this module, you will learn about server-side scripts, such as Active Server Pages You will also learn the ASP object model (View Userinfo.htm from Sampapps) Delivery Tip From Internet Explorer, open Userinfo.htm from the address http://localhost/1912/Samp apps/Ch05/Userinfo.htm Show students what happens when the form submitted without filling the name and the e-mail address Ask students how the process running in the background knows that the user has not specified the name or the e-mail address in the Employee Registration Form Explain that server-side scripts provide this functionality Tell students that at the end of the module, they will be able to create a similar application using ASP Web pages created with HTML are static in nature However, you can make your Web pages dynamic and interactive by using server-side scripts, such as Active Server Pages (ASPs) You can use ASP in your Web pages to process form information, respond to queries, and work with Microsoft ActiveX® controls After completing this module, you will be able to: ! Define the ASP object model ! Define object oriented programming ! Execute ASP code in Microsoft IIS ! Use ASP objects to capture form information and handle server functions ! Use ASP to process form information Note The sample application files for this module are located in the folder \Inetpub\wwwroot\1912\Sampapps\Ch05 Module 5: Using Server-Side Scripts # Introduction to Active Server Pages (ASPs) Slide Objective To provide an overview of Active Server Pages (ASPs) Lead-in ASPs are used to write server-side scripts ! Working of ASPs ! Microsoft Internet Information Server (IIS) ! ASP Object Model A server-side script, such as ASP, runs on a Web server and returns an HTML page to the user ASP is an open, compile-free application environment in which you can combine HTML, scripts, and reusable ActiveX server components to create dynamic and powerful Web applications ASPs enable server-side scripting for IIS with native support for both Microsoft Visual Basic® Scripting Edition (VBScript) and JavaScript For example, with ASP, you can build Web sites that advertise your company products or you can build information related Web sites that provide up-to-date news to users Also, ASPs are used to retrieve and store form information in a text file or a database Module 5: Using Server-Side Scripts Working of ASPs Slide Objective To explain how ASPs work Lead-in ! ASP scripts run on the Web server The Web server sends back HTML pages to the browser When a browser requests an ASP file from a Web server: $ $ $ The server-side script gets executed ASP processes the requested file, executes the script commands contained in the file, and generates an HTML Web page The Web page is sent back to the browser When a browser requests an ASP file from a Web server: ! The server-side script is executed ! ASP processes the requested file, executes the script commands contained in the file, and generates a Web page ! The Web page is sent back to the browser As the ASP script runs on the Web server, the Web server does all of the processing The Web server generates and sends back HTML-based pages to the browser Tip You can use Notepad to create ASP scripts Microsoft also provides a development tool called Microsoft Visual InterDev® to work with ASP scripts Module 5: Using Server-Side Scripts Microsoft Internet Information Server (IIS) Slide Objective To provide an overview of Microsoft Internet Information Server (IIS) Lead-in IIS comes with Active Server Pages (ASPs) with which you can build dynamic Web pages ! IIS $ Includes ASPs $ Includes the Native Scripting Engine for VBScript $ Includes the Native Scripting Engine for JScript IIS is built into the Microsoft Windows NT® Server operating system IIS uses the Windows NT User Manager to maintain users and groups, which saves you the trouble of maintaining multiple sets of network and Web site users IIS also utilizes the Windows NT Event Viewer and Performance Monitor to view such items as bytes sent per second and current CGI requests In the Windows® 2000 environment, you need to use IIS to run ASP code There is a difference between previewing ASP code in Internet Explorer and previewing a normal HTML code in Internet Explorer When you preview ASP code in Internet Explorer, the Address bar of the browser window displays a path that looks like http://localhost/… This path indicates that the ASP code is run on IIS and not executed by the browser The term "localhost" maps to the folder \Inetpub\wwwroot The file that contains the ASP code must reside under the folder \Inetpub\wwwroot However, when you preview normal HTML code in Internet Explorer, the path in the Address bar looks like c:/…, which indicates that the HTML file is executed by the browser itself Module 5: Using Server-Side Scripts ASP Object Model Slide Objective To provide an overview of the ASP object model Lead-in IIS implements ASP as an OLE automation server that has a hierarchical object framework, called the ASP object model ! Response Object ! Request Object ! Session Object ! Application Object ! Server Object ASP provides a set of objects that can be manipulated with scripting languages There are five predefined objects provided by ASP, which are used in the interaction between browsers and Web servers The table below lists and describes the ASP objects Object Description Response Used to generate the response that is sent back to the browser Request Contains information sent by the browser to the Web server Session Contains user specific information Application Contains global information for Web applications Server Provides common functionalities and access to COM objects Module 5: Using Server-Side Scripts # Object Oriented Programming (OOP) Concepts Slide Objective To provide an overview of Object Oriented Programming (OOP) Lead-in OOP is a programming technique that enables development of programs ! Properties ! Methods (View survey.htm and Object.htm from Sampapps) Delivery Tip From Internet Explorer, open Survey.htm from the address http://localhost/1912/Samp apps/Ch05/Survey.htm Show students what happens when the form is filled in and submitted While browsing the Web, you may have noticed pages containing various types of control elements, such as push buttons, text boxes, radio buttons, and check boxes These controls are called objects Object-oriented programming enables you to write code that is associated with specific objects An object is a piece of code that combines data and processes that operate on the data An object performs a set of activities that define its behavior Objects can contain other objects To use an object, you need to use its properties, methods, or events Consider the following code that uses the Request and Response objects Delivery Tip From Notepad or FrontPage, open Results.asp from the folder \Inetpub\wwwroot\1912\Sam papps\Ch05 Briefly explain the use of methods and properties of the Request and the Response object with the help of the source code Confirmation Page

... Robert Stewart Module 5: Using Server -Side Scripts iii Instructor Notes Presentation: 165 Minutes Lab: 60 Minutes This module provides students with an overview of server -side scripts, such as... teach this module, you need the following materials: ! Microsoft PowerPoint file 1912A_05.ppt ! Module 5, ? ?Using Server -Side Scripts? ?? ! Lab 5, “Processing Form Data Using Server -Side Scripts? ?? Preparation... To prepare for this module, you should: ! Read all of the materials for this module ! Complete the practices and lab in this module iv Module 5: Using Server -Side Scripts Module Strategy Use

Ngày đăng: 11/12/2013, 14:15

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan