All source code in ASP/ VbScript Ask a ASP/ VbScript Pro Discussion Forum Categories All jobs in ASP/ VbScript
Quick Search for:  in language:    
active server pages, ASP, vbscript,tutorial, newbie, beginner, how, to, how to program, help
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 281,603. lines
 Jobs: 101. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login

NEW! LEARNING CENTER
Special educational offers, white papers, webcasts, podcasts

  NEW! Download Rational Performance Tester V8 (download now)
  NEW! Download Rational Functional Tester V8 (download now)
  NEW! Download Rational Service Tester for SOA Quality V8 (download now)
  NEW! Teleconference: Quality In Action - Using Rational Quality Manager with Functional, Performance and Web Service Testing Products (download now)
  NEW! Introducing IBM Rational AppScan Developer Edition – easing security testing by non-security professionals (download now)

 

 


Latest postings for ASP/ VbScript.
Click here to see a screenshot of this code!IT Department Complaint Register
By AMIT MESHRAM on 12/2

(Screen Shot)

Chat
By G.Chenna Subramani on 11/26


Click here to see a screenshot of this code!Mess Officer Management System (Sistem Pengurusan Mess Pegawai)
By Mohd Fauzi on 11/23

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 

Back to Tutorial Index

Intro to ASP syntax
By Brad Hess (hessb@4aspdev.com)
Reprinted with permission from http://www.4aspdev.com


Let’s code our first ASP page. To do this write out the following code in your choice of development environment.
<HTML>
    <
BODY>
        <
B>Welcome to my webpage hosted on PWS!</B
>
        <
BR>The time is now: <%=Response.Write(TIME())%>
        <
BR>
     </
BODY
>
</
HTML>

Save the file in the c:\Inetpub\wwwroot\ directory on your machine and name it default.asp. Try accessing your website by opening a browser and typing http://127.0.0.1/default.asp or http://yourmachinename/default.asp. 127.0.0.1 is what is called the loopback address and is the TCP\IP address that points at your machine. The text: Welcome to my webpage hosted on PWS! should now show up. On the line under you should read "The time is now:" followed by the current time. Like this only without the Back link. If the time is showing up correctly you have a working ASP server running on your PC!. If the time does not show up correctly then something is wrong with the installation of personal web server

Now that we have an ASP page. Lets look at what is really happening when the page is requested. The code is as follows
<HTML>
    <
BODY>
        <
B>Welcome to my webpage hosted on PWS!</B
>
        <
BR>The time is now: <%=Response.Write(TIME())%>
        <
BR>
     </
BODY
>
</
HTML>

The code color syntax is the same as you will see in Interdev and Frontpage.  Most of the code in this page is plain HTML, however the inside  <% and %> is ASP code.  The <% and %>  seperates the HTML code from ASP code.  The server recognizes the <% and %> and processes anything contained inside.  Response.Write calls the Response Object that is part of the ASP object model. The write part of response.write calls the write method of that object. I will expand upon this more in the future. TIME() is recognized by the script engine as a function that retrieves the current time.

You just created your first dynamic website every time it is requested it will be updated with the current time on the server. While this is not really helpful it works well as an example.

Now lets take a look at the object model so that we get a better idea of what all ASP supports.


Back to Tutorial Index








 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997-2008 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.