1. TTfile
  2. ASP File
  3. How to create ASP page?

How to create ASP page?

If you are reading this page, you are assumed to be new to Classic ASP and want to create your first dynamic ASP web page.

Please first make sure that you have installed IIS (Internet Information Services) on your system as you need one of these web servers to be able to view a page containing ASP (just opening the page in your web browser by double-clicking on the page will NOT work). If you are unsure on how to install IIS please read the tutorials on, installing IIS.

For those that do not wish to mess around attempting to install IIS (Internet Information Services) on their own computer, there are many hosting companies that supply Windows ASP Hosting including our own Free ASP Website Hosting Service.

Now you can begin creating your first ASP page.

The instructions below will display the classic 'Hello World' text in an web page as well as the time on the web server.

As ASP is going to be displayed as part of a web page, you first need to create an HTML web page, open up your favourite text editor and type the following.

1

Next you can begin writing some ASP. Any ASP needs to be placed in between the tags, <% ........ %>, to indicate server-side script. In this next part you will start the server side script tag and create a variable to hold the text 'Hello World'.

2

Notice that the variable 'strMessage' a data type has not been given , because VBScript only has variant as a data type.

Now you have created a variable to be given the value 'Hello World'.

3

Once the variable has a value you can now display the contents of the variable in the HTML by using the ASP 'Response.Write' method to place the contents of the variable into the HTTP stream.

4

Next you should use the 'Response.Write' method to write a line break into the HTML to create a new line before displaying the server time.

5

Again using the 'Response.Write' method and the VBScript function 'Time()' you should now display the server time on the HTML page and close the serer side script tag as you have finished using ASP in this part of the web page.

6

Finally you need to finish the HTML web page by closing the body tag and the HTML tag.

7

Next, call the file, 'my_first_asp_page.asp' (don't forget the '.asp' extension) and save the file to a directory accessible through your web server (this will usually be, 'c:\inetpub\wwwroot', on IIS or PWS with a defualt install).

To display the page open your web browser and type 'http://my_computer/my_first_asp_page.asp', where 'my_computer' is replace this with the name of your computer.

And that's about it, you have now created your first dynamic ASP web page!