VBScript Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 5.00

Static, Client-Side and Server-Side Scripting Pages

This section describes differences of static content, client-side scripting code, and server-side scripting code.

If you are using IIS as the Web server and IE as the Web browser, you can 3 types of contents into a Web page:

  • Static Contents - Text and HTML tags provided directly for IE to construct the Web page.
  • Client-Side Scripting Contents - VBScript code for IE to execute. Client-side scripting code will add new contents or update existing contents of the Web page. Client-side scripting code can also handling user input on the client machine.
  • Server-Side Scripting Contents - VBScript code for IIS to execute. Server-side scripting code will add new contents or update existing contents of the Web page. Server-side scripting code can also interact with other applications on the server, like database servers.

Here, I have 3 Web pages to display a time in 3 different ways: static content, client-side scripting code, and server-side scripting.

1. time_static.html: A static page displaying a static time.

<html><body>The current static time is: 
11/26/1999 10:19:46 PM 
</body></html>

If you open this page with any Web browser, you should see the static time, which will not change when you open the page again some time later.

The current static time is: 11/26/1999 10:19:46 PM 

2. time_client.html: A client scripting page displaying the time dynamically out of the client system.

<html><body>The current client time is: 
<script language="vbscript">
document.write(Date & " " & Time)
</script>
</body></html>

If you open this page with any Web browser that can execute VBScript statements, like MS Internet Explorer (IE) 5, you will see the current time of the client system. The displayed time will change when you open the page again some time later.

The current client time is: 11/26/1999 10:26:08 PM 

3. time_server.asp: A server scripting (ASP) page displaying the time dynamically out of the server system. File name extension ".asp" is needed to inform Web server to be ready to execute the embedded script statements.

<%@ language="vbscript"%>
<html><body>The current server time is: 
<%
response.write(Date & " " & Time)
%>
</body></html>

Since an ASP page needs a Web server to execute the script statements, you need to copy this page to the document directory of the IIS server:

copy time_server.asp \inetpub\wwwroot

If you now open this page with IE 5 at http://localhost/time_server.asp, you will see the current of the server system. The displayed time will change when you open the page again some time later.

The current server time is: 11/26/1999 10:43:32 PM 

Notice that I am using the same scripting language, VBScript, for both time_clien.html and time_server.asp.

Sections in This Chapter

What is ASP (Active Server Pages)?

Static, Client-Side and Server-Side Scripting Pages

Setting Up IIS to Run ASP Pages - asp.dll

ASP Objects: Request, Response, Session and Application

ASP Object Example - Passing Values between Pages

Interacting with External Applications - ActiveX Data Object (ADO)

Dr. Herong Yang, updated in 2008
Static, Client-Side and Server-Side Scripting Pages