Vista Software
Apollo ASP Technical Information

Active Server Pages (ASP) Explained

Simple ASP FAQ

What are Active Server Pages?

Active Server Pages are a language-independent framework (i.e. technology) designed by Microsoft for efficient coding of server-side scripts. ASP scripts are designed to be executed by a Web server in response to a user's request for a URL. ASP scripts are similar to other server-side scripting you may be familiar with that are used on other platforms such as Perl, Python, and so on.

With which Web servers can I use Active Server Pages?

Active Server Pages are currently available for these Web servers:

Are Active Server Pages an industry standard?

Active Server Pages are developed and maintained by Microsoft. Although the company has published a lot of information about ASP and associated technologies, ASP has not been approved by any standards body.

Can I use Active Server Pages if my Web server is running on a non-Windows machine?

Maybe. Through the use of ChiliSoft's (www.chilisoft.net) Chili!Soft ASP product, Active Server Pages are also available for a number of other Web servers and operating systems, including a number of Unix variants. Check with ChiliSoft for the latest details regarding which platforms they support.

Why should I choose ASP as opposed to CGI or other scripting methods?

Several good reasons:

  • Performance — With CGI, each script is run as an executable in its own process. As a result, each time a script is requested the server must: create new process, run the script, kill the (just created) process. This is inefficient and can severely impact the performance of the Web server. The Active Server Pages host is not re-launched with every script access and is therefore much more efficient.
  • Session management — Because HTTP is stateless, keeping track of data between page accesses by a user is a tough problem. ASP provides built-in session management functionality that allows developers to persist data and also COM component instances (like database connections) for the duration of a session.
  • Easy integration of COM components — ASP is designed to rely heavily on COM components for its extensibility. As a result, it is very easy to instantiate and use any COM component from within an ASP script.

What is the global.asa file? What is it used for?

The global.asa file allows you to add code that will automatically execute at the start and end of a user session and also at the start and end of the "application." As a developer, you can use the code in the global.asa file to initialize variables at the start of a user session or create application-wide database connections, and so forth.

Do I have to write ASP scripts in VBScript? Isn't ASP supposed to be language-independent?

No, you don't have to write ASP scripts in VBScript if you don't want to. Active Server Pages are actually an ActiveX Scripting Host which can use any compatible ActiveX Scripting Engine. Scripting engines for VBScript and JScript (Microsoft's JavaScript variant) come pre-configured with ASP when installed as part of the Internet Information Server. You can also use any of a number of scripting engines available from third parties. For example, you can get more information about PerlScript, a Perl-based scripting engine, from the ActiveState site at http://www.activestate.com/ActivePerl/docs/perlscript.html .

Do I need to know HTML to program using Active Server Pages?

Although strictly speaking, knowing HTML is not required, as a practical matter you will find knowing HTML to be a necessity. The vast majority of server-side scripting, ASP included, involves doing some kind of server-based processing and then returning a result to the user in the form of an HTML page. As part of your development process, you'll invariably run into situations where your ASP script is running without errors but the HTML it generates does not display correctly in the user's browser. When it comes to debugging these types of problems you'll find that having a good handle on HTML to be invaluable.

If I write scripts in ASP will my users be able to see my code?

If your Web server is properly configured, then users will only see the HTML output your ASP script generates, not the ASP code itself. Essentially, you need to uncheck a checkbox on IIS that says "Allow directory browsing".

Good ASP programming articles


Apollo Database Engines