ASP   «Prev  Next»

Lesson 2 Server-side scripting
ObjectiveCompare server-side and client-side scripting.

Compare Server-side and Client-side Scripting

If you develop Web pages or applications, Microsoft's ASP performs two very important tasks:
  1. It lets you run scripts on the Web server instead of the client, a user's browser; and
  2. It allows you to incorporate scripting commands as a part of your HTML pages.

If you have already written scripts in JavaScript, VBScript , or Perl, you will recognize that ASP pages look very similar.

Server-side scripting

The key difference between scripts you might have written before and those you write with ASP is that ASP scripts run on the Web server, not through the user's browser program.
When you design a Web application, you can choose to use client-side techniques ,in which scripts are run through the user's browser, or server-side techniques, in which scripts are run from the Web server, or a combination of the two. The most common client-side technologies are Java, VBScript, JavaScript, and JScript .
The most common technologies on the server side are:
  1. Common Gateway Interface (CGI)
  2. Server APIs
  3. and ASP.

Client-side approaches are usually easier to implement and do not require access to a Web server; they become complicated when you have to support different types of browsers.
Server-side solutions offer central management through Web servers' computing resources, which usually include large amounts of memory and storage. Although server-side scripting can be a little more complicated, ASP has features, presented in later lessons, to make it easier.

Example of Classic ASP Scripting

This SlideShow illustrates an example of ASP scripting in an HTML page and its interpretation for the browser that has accessed the page:


  1. The user's browser requests an ASP Page just as it would any static HTML page.
  2. To the server, most ASP pages look like HTML pages with scripts embedded in them.
  3. The result of this process is an HTML page, which is transmitted to the browser
  4. The user's browser displays the resulting HTML code sent by the server.

ASP Responds Browser Reequest
Although the user views the result of the ASP code, calculations or decisions behind the result are not evident.
This characteristic is important as we discuss ASP functions and statements in a later lesson. The next lesson will examine an ASP script and its syntax.

JScript: Originally, Microsoft's clone of JavaScript, but now an implementation of the ECMAScript 262 standard for a Web scripting language and is was very similar to JavaScript.