8
ASP Introduction ASP Introduction Y.-H. Chen Y.-H. Chen International College International College Ming-Chuan University Ming-Chuan University Fall, 2004 Fall, 2004

ASP Introduction

  • Upload
    nishan

  • View
    29

  • Download
    0

Embed Size (px)

DESCRIPTION

ASP Introduction. Y.-H. Chen International College Ming-Chuan University Fall, 2004. What you should already know. WWW, HTML and the basics of building Web pages A scripting language like JavaScript or VBScript Object-oriented programming concept. What is ASP?. - PowerPoint PPT Presentation

Citation preview

Page 1: ASP Introduction

ASP IntroductionASP Introduction

Y.-H. ChenY.-H. ChenInternational CollegeInternational College

Ming-Chuan UniversityMing-Chuan UniversityFall, 2004Fall, 2004

Page 2: ASP Introduction

22

What you should already What you should already knowknow

• WWW, HTML and the basics of WWW, HTML and the basics of building Web pages building Web pages

• A scripting language like JavaScript A scripting language like JavaScript or VBScriptor VBScript

• Object-oriented programming Object-oriented programming conceptconcept

Page 3: ASP Introduction

33

What is ASP?What is ASP?

• ASP stands for ASP stands for AActive ctive SServer erver PPages ages • ASP is a program that runs inside ASP is a program that runs inside IISIIS • IIS stands for IIS stands for IInternet nternet IInformation nformation SServices ervices • IIS comes as a free component with IIS comes as a free component with Windows 2000Windows 2000 • IIS is also a part of the IIS is also a part of the Windows NT 4.0 Option Windows NT 4.0 Option

PackPack • The Option Pack can be The Option Pack can be downloadeddownloaded from Microsoft from Microsoft • PWSPWS is a smaller - but fully functional - version of IIS is a smaller - but fully functional - version of IIS • PWS can be found on your PWS can be found on your Windows 95/98 CDWindows 95/98 CD

Page 4: ASP Introduction

44

What is an ASP File? What is an ASP File?

• An ASP file is just the same as an An ASP file is just the same as an HTML file HTML file

• An ASP file can contain text, HTML, An ASP file can contain text, HTML, XML, and scripts XML, and scripts

• Scripts in an ASP file are executed on Scripts in an ASP file are executed on the server the server

• An ASP file has the file extension An ASP file has the file extension ".asp" ".asp"

Page 5: ASP Introduction

55

How Does ASP Differ from How Does ASP Differ from HTML? HTML?

• When a browser requests an HTML file, When a browser requests an HTML file, the server returns the file. the server returns the file.

• When a browser requests an ASP file, When a browser requests an ASP file, IIS passes the request to the ASP IIS passes the request to the ASP engine. The ASP engine reads the ASP engine. The ASP engine reads the ASP file, line by line, and executes the file, line by line, and executes the scripts in the file. Finally, the ASP file is scripts in the file. Finally, the ASP file is returned to the browser as plain HTML. returned to the browser as plain HTML.

Page 6: ASP Introduction

66

What can ASP do for you? What can ASP do for you?

• Dynamically edit, change or add any content of a Web page Dynamically edit, change or add any content of a Web page • Respond to user queries or data submitted from HTML Respond to user queries or data submitted from HTML

forms forms • Access any data or databases and return the results to a Access any data or databases and return the results to a

browser browser • Customize a Web page to make it more useful for individual Customize a Web page to make it more useful for individual

users users • The advantages of using ASP instead of CGI and Perl, are The advantages of using ASP instead of CGI and Perl, are

those of simplicity and speed (?)those of simplicity and speed (?)• Provides security since your ASP code can not be viewed Provides security since your ASP code can not be viewed

from the browserfrom the browser• Since ASP files are returned as plain HTML, they can be Since ASP files are returned as plain HTML, they can be

viewed in any browser viewed in any browser • Clever ASP programming can minimize the network traffic Clever ASP programming can minimize the network traffic

Page 7: ASP Introduction

77

How to install IIS and run ASP How to install IIS and run ASP on Windows 2000 on Windows 2000 1.1. From your From your Start ButtonStart Button, go to , go to SettingsSettings, and , and Control PanelControl Panel 2.2. In the Control Panel window select In the Control Panel window select Add/Remove ProgramsAdd/Remove Programs 3.3. In the Add/Remove window select In the Add/Remove window select Add/Remove Windows Add/Remove Windows

ComponentsComponents 4.4. In the Wizard window check In the Wizard window check Internet Information ServicesInternet Information Services, ,

click OKclick OK 5.5. An An Inetpub folderInetpub folder will be created on your harddrive will be created on your harddrive 6.6. Open the Inetpub folder, and find a folder named Open the Inetpub folder, and find a folder named wwwrootwwwroot 7.7. Create a new folderCreate a new folder, like "MyWeb", under wwwroot. , like "MyWeb", under wwwroot. 8.8. Use a text editorUse a text editor to write some ASP code, save the file as to write some ASP code, save the file as

"test1.asp" in the "MyWeb" folder "test1.asp" in the "MyWeb" folder 9.9. Make sure your Web server is running - The installation program Make sure your Web server is running - The installation program

has added a new icon on your task bar (this is the IIS symbol). Click has added a new icon on your task bar (this is the IIS symbol). Click on the icon and press the Start button in the window that appears. on the icon and press the Start button in the window that appears.

10.10.Open your browserOpen your browser and type in and type in "http://localhost/MyWeb/test1.asp", to view your first ASP page "http://localhost/MyWeb/test1.asp", to view your first ASP page

Page 8: ASP Introduction

88

How to install IIS and run ASP How to install IIS and run ASP on Windows XP Professional on Windows XP Professional 1.1. Insert the Windows XP Professional CD-Rom into your CD-Rom Drive Insert the Windows XP Professional CD-Rom into your CD-Rom Drive 2.2. From your From your Start ButtonStart Button, go to , go to SettingsSettings, and , and Control PanelControl Panel 3.3. In the Control Panel window select In the Control Panel window select Add/Remove ProgramsAdd/Remove Programs 4.4. In the Add/Remove window select In the Add/Remove window select Add/Remove Windows ComponentsAdd/Remove Windows Components 5.5. In the Wizard window check In the Wizard window check Internet Information ServicesInternet Information Services, , click OKclick OK 6.6. An An Inetpub folderInetpub folder will be created on your harddrive will be created on your harddrive 7.7. Open the Inetpub folder, and find a folder named Open the Inetpub folder, and find a folder named wwwrootwwwroot 8.8. Create a new folderCreate a new folder, like "MyWeb", under wwwroot. , like "MyWeb", under wwwroot. 9.9. Use a text editorUse a text editor to write some ASP code, save the file as "test1.asp" in to write some ASP code, save the file as "test1.asp" in

the "MyWeb" folder the "MyWeb" folder 10.10.Make sure your Web server is running - The installation program has Make sure your Web server is running - The installation program has

added a new icon on your task bar (this is the IIS symbol). Click on the icon added a new icon on your task bar (this is the IIS symbol). Click on the icon and press the Start button in the window that appears. and press the Start button in the window that appears.

11.11.Open your browserOpen your browser and type in "http://localhost/MyWeb/test1.asp", to and type in "http://localhost/MyWeb/test1.asp", to view your first ASP page view your first ASP page

Note:Note: You cannot run ASP on Windows XP Home Edition. You cannot run ASP on Windows XP Home Edition.