|
Introduction To ASP
What Is ASP?
Microsoft Active Server Pages (ASP) is a server-side scripting environment that you can use to create and run dynamic, interactive Web server applications. With ASP, you can combine HTML pages, script commands, and COM components to create interactive Web pages or powerful Web-based applications, which are easy to develop and modify. For example, you can use the ActiveX Data Objects (ADO) components to add database connectivity to your Web pages.
How ASP Works
When you incorporate ASP into your Web site, here's what happens:
- The user brings up a Web site where the default page has the extension .asp.
- The browser requests the ASP file from the Web server.
- The server-side script begins to run with ASP.
- ASP processes the requested file sequentially (top-down), executes any script commands contained in the file, and produces an HTML Web page.
- The Web page is sent to the browser.
The following illustration shows the transmission of dynamically generated content where the displayed date reflects the date at the time of the request.

Because your script runs on the server, the Web server does all of the processing and standard HTML pages can be generated and sent to the browser. This means that your Web pages are limited only by what your Web server supports.
Internet Information Services (IIS)
To run ASP on your computer you will need the Internet Information Services (IIS) component installed on your machine.
IIS 6.0 is included with Windows Server 2003 and is installed via the Add or Remove Programs item in the Control Panel. IIS 6.0 installs in a highly secure state, serving only static HTML content until other features and file types (such as ASP and ISAPI) are enabled.
IIS 5.1 comes with Windows XP Professional and is installed via the Add or Remove Programs item in the Control Panel.
IIS 5.0 comes with Windows 2000 Server and is installed by default. It also comes with Windows 2000 Professional and is installed via the Add or Remove Programs item in the Control Panel.
IIS 4.0 is available in Windows NT 4.0 Option Pack for Windows NT Server 4.0.
If you run Windows 98, Windows Me, Windows NT 4.0 Workstation, you can install Personal Web Server (PWS). PWS 4.0 is a scaled-down version of IIS. PWS is also available in Windows NT 4.0 Option Pack and Windows 98 CD.
Following are the instructions to install IIS component on a Windows XP Professional machine:
- Place the Windows XP Professional CD-Rom into your Optical Drive.
- Open Add/Remove Windows Components found in Add/Remove Programs in the Control Panel.
- Check Internet Information Services (IIS) checkbox and click Next.
- Once the installation is completed, you can view your home page by typing "http://localhost/" into the address bar of your browser.
- The default web directory to place the web site is in 'C:\Inetpub\wwwroot', but you can always set up your own virtual directory through the IIS Manager. For more information, see Creating Virtual Directories in IIS below.
Local IIS Web Sites
A local Internet Information Services (IIS) Web site is an IIS Web application on your computer. Creating or opening a local IIS Web site is useful in the following situations:
- You want to test your Web site using IIS, which closely emulates how the Web site will run on a production server. This can have advantages over working with file system Web sites that run using the ASP Development Server, because paths are resolved as they will be on a production server.
- You already have a set of Web site files in a folder and you want to test the Web site with IIS. In this case, you can create a virtual directory in your local version of IIS.
- Your local computer is also your Web server.
Requirements
To create a local IIS Web site requires the following:
- Your computer must have at least IIS version 4.0 installed and running.
- ASP must be enabled in IIS version 6.0. To enable ASP by using IIS Manager, expand the local computer, and then click Web Service Extensions. In the details pane, click Active Server Pages, and then click Allow.
- You must be logged in as a user with administrative privileges. This is required because working with the IIS metabase (where information about IIS applications is stored) requires administrative privileges.
To open an existing local IIS Web site, the preceding must be true as well as the following:
- The site to be opened must be configured as an IIS application. For more information, see Creating Virtual Directories in IIS below.
Note: You can create an IIS application as a subfolder of any existing IIS folder.
Running Local IIS Web Sites
When you run a local IIS Web site to test it, launches a browser and runs the Web site using the server name localhost. For example, if you have created the Web site ExampleSite, when you test it, go to the following URL: http://localhost/ExampleSite/ IIS resolves the application name, whether it points to a folder that is under the IIS root or to another location, and serves pages from that folder.
Deploying Local IIS Web Sites
Local IIS Web sites are generally used only for development, so that individual developers can create and test ASP Web pages on their own computers. In most cases, you must deploy the files from a file system Web site to a production server that is running IIS.
Creating Virtual Directories in IIS
In most cases, the content you publish to your Web or FTP site is located in a root or home directory on your computer, such as C:\Inetpub\wwwroot\. However, there might be instances when the content is located somewhere else, or even on a remote computer.
To publish from any directory not contained within your home or root directory, you can create a virtual directory. A virtual directory is a directory that is not contained in the home directory but appears to client browsers as though it were.
You can create a virtual directory through IIS Manager or by using Windows Explorer.
Important: You must be a member of the Administrators group on the local computer to perform the following procedures.
»
|