Thursday, March 31, 2011

Inserting VBScript into an Active Server Page (.asp)

To create an Active Server Page, the file is normally stored with the .asp extension in a directory on a web server that can process Active Server Pages. You can blend VBScript with normal HTML when creating your Active Server Pages. See below:

<%@ Language=VBScript %>
   <META  NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    dim helloString
  helloString = "Hello  World!"
    <P><% Response.Write  helloString % ></P>

In the above helloworld.asp page, the first line instructs the server that the default scripting language used in this page will be VBScript. Internet Information Server (IIS) uses VBScript as the default scripting language if the language directive is omitted from a page.

To turn on the server side VBScript interpreter you use the less than followed by the percent “<%” characters. To turn off the server side VBScript interpreter you use the percent sign followed by the greater than sign “%>”. Both are indicated in bold in the above example.

No comments:

Post a Comment