All asp pages are saved as .asp files instead of .htm
As they require the server to process them, you will need to test them on either your web server or a copy of Personal Web Server which is available with all versions of Windows except 3.1 and 95. You will need your windows installation disk, and choose Windows Setup from the control panel / add or remove programs. The operation of this is outside the scope of this lesson, at least at this stage.
Your web site will by default be placed in c:\inetpub\wwwroot we can test this by adding a simple asp page to this folder then asking the web server to process it by typing in a special url into internet explorer.
ASP pages can be normal HTML pages, with additional code designated between special opening and closing tags as follows:
<% response.write now() %> This line actually means add the current date and time to the web page, in VBScript. Not as difficult as it sounds?
Lets make a new blank web page, like we did before, but this time lets save it as "asptest.asp".
Choose File | New HTML document.
In the body area (between the body tags) type
The current date and time is :
Then add the asp including the special opening and closing tags as follows :
<% response.write now() %>
Notice how EHTML colours the asp code in purple to differentiate it from the rest of the web page.
Save your file as asptest.asp in the special root folder of your web server c:\inetpub\wwwroot, or upload it to your web site using ftp. The page can now be viewed using http://127.0.0.1/asptest.asp locally or http://www.mydomain.com/asptest.asp if you have uploaded it.
The web page should be displayed similar to
The current date and time is 01/07/2002 12:00:00"
What if it didn't work - is the date and time missing? Looks like the server isn't set up for asp - ask your hosting company.
And if the whole thing shows up - asp tags and all - you are viewing the page as text - rather than from a server, so you need to get online or set up Personal Web Server as mentioned above.
[ Back ] | [ Index ] | [ Next Lesson ]