How to Create an ASP Page with VBScript
VBScript is a scripting language developed by Microsoft used to write the instructions to be executed on the server. In order to create an ASP page with VBScript, you need to include a directive to indicate the language used on the page is VBScript. The following instructions show how to create an ASP page using VBScript as the scripting language.
- Open your text editor.
- Enter the language directive. This tells the web server you are using VBScript.
- The next statement to add is the Option Explicit statement. This statement checks that all variables used are declared using the Dim statement.
- Declare your variables using Dim statements. These statements can be on separate lines or on the same line separated by a comma as shown here:
- Assign values to your variables.
- Write the values of your variables to the web page.
- Document your code using comments preceded with an apostrophe.
- Use <% to indicate the beginning of the VBScript and %> to indicate the end of the script. The complete example is shown here:
- Save your file as vbscriptpage.asp.
- Browse to the location of file firstasp.asp which you just saved and select it.
- Your page will appear as below in your browser.