Home

 

ASP ADVANCED

           This chapter formally introduces you to Active Server Pages, the subject of this-Tutorial. You learn what Active Server Pages are, what you can do with them, and how they work.  The chapter provides a thorough explanation of how to integrate Active Server Pages scripts into an HTML page, and includes an overview of the objects and components of Active Server Pages.

What Are Active Server Pages?

An Active Server Page is a standard HTML file that has been extended with additional features.  Like a standard HTML file, an Active Server Page can contain HTML tags that will be interpreted and displayed by a web browser.  Any Thing you could normally place in an HTML file - Java applets, blinking text, client-side scripts, client-side ActiveX controls-you can place in an Active Server Page.  However, an Active Server Page has four important features that make it unique:-

  • An Active Server Page can contain server-side scripts.  By including server-side scripts in an Active Server Page, you can create Web pages with dynamic content.  To take an extremely simple example, you could create a Web page that displays different messages at different times of the day.

  • An Active Server Page provides a number of built-in objects.  By using the built-in objects accessible in an Active Server Page, you can make your scripts much more powerful.  Among other things, these objects allow you to both retrieve information from and send information to browsers, For example, by using the Request object, you can retrieve the information that a user has posted in an HTML form and respond to that information within a script.

  • An Active Server Page can be extended with additional components.  Active Server Pages comes bundled with a number of standard server-side ActiveX components.  These components allow you to do such things as determine the capabilities of different Web browsers or include a page counter on a Web page.

    • These standard ActiveX components are very useful.  However, you're not limited to only these components.  You can create additional ActiveX components of your own.  This means that there's no limit to how you can extend Active Server Pages.

  • An Active Server Page can interact with a database such as Microsoft SQL Server.  By using a special collection of objects, the ActiveX Data Objects (ADO), you can use SQL within your Active Server Pages.

Again, this is a very powerful feature of Active Server Pages.  By creating Active Server Pages that can interact with a database, you can create very advanced Web sites.

these four features define an Active Server Page.  An Active Server Page is a standard HTML page that has been extended with server-side scripts, objects, and components.  By using Active Server Pages, you can create Web sites with dynamic content.

The discussion of Active Server Pages in this book assumes that you'll be using Active Server Pages with Microsoft's Internet Information Server.  However, you can use Active Server Pages with many other Web servers as well.  Active Server Pages can be used with Microsoft's Per­sonal Web Server for Windows 95 and the Peer Web Server for Windows NT.

You aren't even limited to using Active Server Pages with Microsoft Web servers.  By using Chili!Soft's Chili!ASP, you can use Active Server Pages with the Netscape Enterprise and Fast Track servers, the Lotus Domino and Go servers, O'Reilly's WebSite, and many other Web servers.

What Can You Do with Active Server Pages?

There's no limit to what you can accomplish with Active Server Pages. just about any Web site that exists on the Internet today could have been created with Active Server Pages.  The follow­ing list shows some simple examples of what you can do:-

  • Include rotating banner advertisements on the Web pages of your Web site.

  • Retrieve information entered into an HTML form and store that information in a database.

  • Create personalized Web pages that display different content to different users.

  • Add hit counters to one or more pages of your Web site.

  • Display different Web pages, depending on the capability of a user's browser.

  • Link together multiple Web pages in such a way that they can be navigated easily.

  • Track information about user activity at your Web site and save that information in a custom log file.

Again, these are very simple examples.  As you read through the following chapters, you'll gain a fuller appreciation of what you can accomplish with Active Server Pages.  Whatever your Web project may be, you'll learn how to complete it using Active Server Pages.