VBScript with Active Server Pages

At root, web servers are pieces of software: they receive an incoming client request and handle it by transmitting a stream of bytes back to the client. Getting the web server to do something elsefor instance, to respond to user interaction by sending back one byte stream rather than another, to save user state information from page to page, to add data from a database to the byte stream returned to the client, or to perform backend processing on the client requestrequires a web server extension. Traditionally,web server extensions for Windows were developed using two technologies: Common Gateway Interface (CGI) and Common Gateway Interface for Windows (WinCGI). These are out-of-process extensions that communicate with the web server through standard input and output (in the case of CGI) or initialization files (WinCGI), which are both very inefficient methods that do not scale well. Microsoft Internet Information Server 1.0 added a new technology, Internet Server Application Programming Interface (ISAPI), that allowed developers to create applications or filters that ran in the same process as the web server, thus achieving better performance and greater scalability. Unfortunately, developing ISAPI applications and filters required an experienced C or C++ programmer, and thus was out of the reach of the vast majority of web content providers.

Active Server Pages was first introduced in Microsoft Internet Information Server 3.0 and allows web server extensions to be developed using scripts that can be written in any language that supports Microsoft's Component Object Model (COM)although the most common language for developing ASP scripts is VBScript. This makes ASP application development accessible to more web content providers than any previous technology for creating shell extensions.

In addition, Active Server Pages allows for the use of server-side components (that is, of COM components written in any of a number of programming languages, most notably Visual Basic) to enhance and better control web applications. The reasons for developing an ASP component rather than a simple script include the items shown in the following list.

  • The functionality that an application requires is not available from VBScript or other scripted languages.
  • The functionality is to be implemented in multiple web pages or web applications, rather than for just one web page or web application.
  • The component offers significantly better performance than its scripted counterpart. That is, the scripted equivalent of the component is a performance bottleneck.

For a book that shows how to develop ASP components using Visual C++, Visual Basic, and Visual J++, see Developing ASP Components, by Shelley Powers (O'Reilly & Associates).

Part I: The Basics

Introduction

Program Structure

Data Types and Variables

Error Handling and Debugging

VBScript with Active Server Pages

Programming Outlook Forms

Windows Script Host 5.6

VBScript with Internet Explorer

Windows Script Components

Part II: Reference

Part III: Appendixes

Appendix A. Language Elements by Category

Appendix B. VBScript Constants

Appendix C. Operators

Appendix E. The Script Encoder



Vbscript in a Nutshell
VBScript in a Nutshell, 2nd Edition
ISBN: 0596004885
EAN: 2147483647
Year: 2003
Pages: 335

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net