WebDesignChat
 
Partners
Web Design Resources
Web Designers Directory
Html Help
WPDFD
Tip Tricks
Page Resource
Design Companies
Website Design
Ceonex Web Design
LevelTen Design
Web Designing
Resources
Web Hosting Reviews
Free Design Stuff
Free Fonts
Free Graphics
Stylesheet Editor
Web Editor
Form Mail Script
Free Search Engine Submission
Photoshop Tutorials
Advertise Here
Welcome to WebDesignChat.org. Web Design chat is a one stop place to chat about all the latest happenings going in web design field. Here you can increase your knowledge as well as help others to grow their knowledge on Web Designing.


Go Back   Web Design Forum > Web Programming > ASP and MS SQL
User Name
Password
Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-16-2005, 07:01 AM
jennifer jennifer is offline
Junior Member
 
Join Date: Jun 2005
Posts: 18
Wink Asp Program Tutorial

This ia newbies tutorial to learn making first program in ASP -

Before we can begin please make sure you have installed PWS or IIS 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 PWS or IIS please read the tutorials on installing IIS.

You can install IIS through tutorial at http://www.webdesignchat.org/showthread.php?p=20

Right, now we have got that out the way we can begin creating your first ASP page.

In this tutorial we are going to 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 we first need to create an HTML web page, open up your favourite text editor and type the following.
<html>
<head>
<title>My First ASP Page</title>
</head>
<body bgcolor="white" text="black">


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


Notice I haven't given the variable 'strMessage' a data type, this is because VBScript only has variant as a data type.

Now we have created a variable were going to give it the value 'Hello World'.
'Place the value Hello World into the variable strMessage
strMessage = "Hello World"


Once the variable has a value we 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.
'Write the contents of the variable strMessage to the web page
Response.Write (strMessage)


Next we shall use the 'Response.Write' method to write a line break into the HTML to create a new line before displaying the server time.
'Write line break into the web page
Response.Write ("<br>")


Again using the 'Response.Write' method and the VBScript function 'Time()' we shall now display the server time on the HTML page and close the serer side script tag as we have finished using ASP in this part of the web page.
'Write the server time on the web page using the VBScript Time() function
Response.Write ("The time on the server is: " & Time())

'Close the server script
%>


Finally we need to finish the HTML web page by closing the body tag and the HTML tag.
</body>
</html>


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.

Thats it...you have just created your first Active server page...

Hurrayyyyy !!
Reply With Quote
Sponsored Links
  #2  
Old 10-16-2005, 08:36 PM
zac123 zac123 is offline
Junior Member
 
Join Date: Oct 2005
Posts: 3
Default excellent! one question though...

thanks for the tuitorial, ive been looking for some help with the basics for some time.

i have just one question though... i have iis installed (someone did it for me) if the new asp page is to be stored i the wwwroot folder, should this be my site root? should all of my pages be stored in there? and when i ftp to my host should i have my root folder there also called wwwroot etc.

sorry hat was actually a few questions

zac
Reply With Quote
  #3  
Old 06-30-2008, 12:08 PM
mnop534 mnop534 is offline
Member
 
Join Date: Jun 2008
Posts: 35
Arrow good topic

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




All times are GMT. The time now is 01:02 AM.
Powered by: vBulletin Version 3.0.3

Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.