To run ASP, you first will need IIS web server. We assume that the root of server is C:/mywebpage. Let’s “firstpage.asp” to be our first asp web page file, in order to run this file , set the URL of web browser to :
- Code:
http://localhost/ firstpage.asp
Note you have to set the ISS setting to point to C:/mywebpage as default root. Now, how our file first? We start the web page by telling the application server that we are using VB-script:
- Code:
<%@ Language=VBScript %>
In this case we are using VBScript for asp server side programming. The next part is the declarations of variables to be used later in our application.
- Code:
<% Option Explicit %>
Following show declaration of a variable and assigning a string value to it, we define the variable using
“Dim” command.
Dim myMsg
myMsg =”My string”
You can print the content of this variable using “Response” object and “Write” function. Following is full and simple example, as you notice that the VB-script code is embedded with HTML code:
- Code:
<%@ Language=VBScript %>
<% Option Explicit %>
<html>
<head>
<title>Page Title</title>
</head>
<body >
<%
Dim myMsg
myMsg =”My string”
Response.Write myMsg
%>
</body>
</html>