hitmill.com logo



welcome.asp Example and Code

Code Examples for ASP Newcomers

The code for the ASP in the BODY section of the welcome.asp page is below.
The code line for the date and time is supposed to be all on one line until you read the <br> tag. This code has two FOR NEXT loops to display the text "Welcome,Hello!" in decreasing, then in increasing sizes. The first loop has blue text. The second loop has purple text. The code after the two loops displays the day of the week, the date, and the time. (NOTE: This is the date and the time at the location of the Web server, and not the date and time at your own computer on the client-side.) See the actual page (what is returned to the browser):  welcome.asp 
then view source to see that the ASP tags have been "stripped away", so to speak, by the scripting engine, before delivering the resulting HTML document to the browser.

<BODY bgcolor="linen">
<H4>Hello and Welcome ASP Tutorial
<div align="center">
<% Dim ftsize %>
<% For ftsize = 7 to 1 Step -1 %>
<font size=<%=ftsize%>>
<font color=blue>
Hello, and Welcome!<br>
<% Next %>
<% Dim ft2size %>
<% For ft2size = 1 to 7 %>
<font size=<%=ft2size%>>
<font color=#CC33FF>
Hello, and Welcome!<br>
<% Next %>
<!-- Date and time code follows: -->
<font color=red size=5> It is <% = WeekdayName(Weekday(Date)) %>, <% = Date %>.<BR>
The time is <% = Time %>



Contact Webmaster
© hitmill.com
All Rights Reserved