Export (0) Print
Expand All

Enter Active Server Pages

Visual Studio 6.0

An ASP file is just an HTML file with extended features. ASP files usually contain some HTML tags that are interpreted by the browser, just like those of a standard HTML file. But an ASP file also contains what are called Server Side Scripts. In other words, the ASP file uses code (the scripts) to generate an HTML file with dynamic content. In our example above, we used an ASP file to generate (on the web server – hence server side scripts) a dynamic HTML page that is sent to the browser. When the browser receives the page from the server, all it sees is the HTML page that the server generated - it just plain old HTML, so the browser doesn't need any special features to read and render the server's output. The Active Server Page did all the intelligent work – it used ActiveX Data Objects to retrieve specific content from the database and then created a page that any old browser could read.

That is the real beauty of ASP: the work gets done on the server. The script takes the dynamic information from our database and formats it into standard HTML, and the browser independent, universally readable results are sent to the browser. In our example above showing Wrox titles, the output would certainly look different if we retrieved titles from some other publisher. So ASP, using ADO, formats the page with the specific information we want to show and sends it to the browser.

So ASP uses server-side scripting. This is where the server interprets and executes the script in the .ASP page before it delivers the HTML page to the browser. Like client-side scripting, the script source code is coded in the ASP page. The beauty is that this code is never sent across the wire to the browser! Instead, the server interprets and executes the code and sends the resulting HTML stream to the browser. The HTML stream contains the information that tells the browser what to display (the data) and how to display it (the HTML tags).

This means that we can use ASP and ADO to create HTML files that can be read with any old garden-variety browser - there are no special plug-ins required at the client browser. So even the oldest browsers can read ASP files! Your audience is now everyone on the Internet, on any platform, using any browser. And that translates to a planet-wide audience. Way cool. By now hopefully you are getting comfortable with this alphabet soup of ASP, ADO, and HTML.

© 1998 by Wrox Press. All rights reserved.

© 2014 Microsoft