10 year anniversary

Home


Hosting Directory


Host Search


Request a Quote


Web Hosting News


Hosting Forums


Web Host Awards


Guides
Web Hosting
Choose a Host
Dedicated Servers
Reselling
Free Hosting
Articles
Industry News
HTML Explained
Advanced HTML
ASP Explained


Free Listings on Web Host Directory and drive buyers to your Web Hosting Business





ASP Explorer Back to Articles & Guides 
ASP Training - The Basics

This page will give you the basics of ASP, and this will be asp dedicated to web page output; so we will look at creating pages with ASP; outputting variables; using loops and processing HTML form information for display.

Creating an ASP Page

ASP is, at its most simple, nothing more than a special kind of HTML markup that is interpreted before sending back the viewing browser. To change a basic HTML page into an ASP page all you need to do is change the file extension to .asp! You can see this by looking at this demonstration page.

The page is just HTML, and the code is as follows.



<html>
<head>
	<title>asp demonstration - an asp 
	page with just html markup</title>
</head>
<body>
<h1>Only HTML - no asp</h1>
This page just has HTML, no asp at all, all that 
is different is that the file extension of the page 
is .asp instead of .htm (or .html).
</body>
</html>
So you can see that the only thing different from a standard HTML page is that if you look at the URL (look at Netsite or Location in Netscape; or Address in Internet Explorer) you will see that it ends in .asp rather than .html

So, now you have an ASP page with no ASP. Not very useful, but it shows you how easy it is to go about generating your first ASP page.

Lets make things more interesting by slowly adding some of the ASP that was introduced in
Starting with ASP.

The first bit of ASP was <%@ LANGUAGE="VBSCRIPT" %>. What do all the bits mean? <% and %> are two tags that you will get thoroughly sick of. These tags tell the page that anything between them is ASP and so needs to be interpreted (run) rather than just displayed. These two tages are what allow you to have both HTML and ASP in the same page, when the web server sends the page back to the browsers it will just send any HTML it finds, and anything between the two tags it knows to handle differently and to run as code.

The other thing to note is that looking through that first script for <%and %> is that there is not just one occurance of these two tags, but they can appear as often as required; so you can have some HTML; then some ASP; then some HTML; and some ASP; ad nauseam.

Right, now you know what <% and %> are for; what is that @ LANGUAGE="VBSCRIPT" for. Strictly speaking it is not actually necessary if you are using ASP with VBscritp (as we are doing). What that line does (as long as it is the very first line in the script; is to tell the web server to interpret any asp using VBScript. Now, why would you need to tell the web server to use VBScript? Well, although ASP, by default, uses VBScipt as standard; it also comes with JavaScript, so you could write your ASP pages using JavaScript! Not only that, but there are some other languages that you can get to use with ASP, such as perlScript. If you want to use these other languages you will need to tell the web server that that is what you are doing (and if you are using somthing other than VBScript or JavaScript you will need to install the appropriate software.

So you now know how to recognise ASP tags, and also what @ LANGUAGE="VBSCRIPT" is all about, so know lets move away from the boring stuff and onto the real thing. The next ASP line in the first script is <% response.write("using ASP to write to the page") %>. What does this do? Well, you should be able to spot that from the words and also by looking at the output of the script! Oh, you want some explanation? All that response.write does is allow you to write to the HTML page from inside an ASP script. In this case we are writing out the text string "using ASP to write to the page". Not much point in that as we could just have easily written "using ASP to write to the page" in HTML and saved ourselves the hassel of messing about with ASP. True : but you're forgetting that this is a training page! Besides, you can use response.write for more than just outputting text. You can also use it to output the values of variables that you use in ASP scripts. More of which on next page!

ASP training - The Basics Part 2 >>

Starting with ASP Table of Contents Looping and Form Handling

Featured Hosts
SuperbHosting.Net: Starting as low as $2.50/m, 2 FREE Domains, FREE Setup + WebSiteCreator + Blog Software, Unlimited Traffic, 200 GB HD, your own IP, 2500 Emails, daily backups & more, connected to our coast-to-coast backbone.
$5.95/mo – 6 MONTHS FREE: UNLIMITED Disk Space, UNLIMITED Bandwidth, FREE Domain, FREE Site Builder, FREE Setup, and MORE!
Crystaltech.com: Host with the best! 3 FREE months with a waived setup on any new dedicated server! Call 1-877-323-HOST or visit CrystalTech.com today!
Hivelocity.com: Core2Duo- $119/mo, Core2Quad- $149/mo, Quad-Core Xeon- $185/mo, Dual Quad-Core Xeon- $299/mo, Zero Setup- Free Ram Upgrades
Ace-host.net: 500 GB Disk Space, 5,000 GB Bandwidth, Host up to 20 Domains, Unlimited Email Addresses, 24/7 Technical Support, 99.9% Uptime Guarantee, 30-Day Money Back Guarantee - Starting at $6.95/month
Rackspace: Rackspace delivers fully managed windows and linux hosting solutions, a Zero-Downtime Network(tm) and 24x7x365 Fanatical Support(tm).
Aplus.Net: AWARD-WINNING Hosting at Small Business-Friendly Prices (from $5.95 / mo.) - FREE Setup - FREE Domain - 99.9% Uptime - 24/7 Support - LIMITED TIME SALE!
hostgator.com: CALL NOW 1-866-96-GATOR >> 24/7 >>PHONE AND INSTANT MESSENGER SUPPORT >>A TON OF SPACE!! >>> TONS OF >>BANDWIDTH! >> FREE SETUP >> DOZENS OF FREE SCRIPTS INSTALLED >>
Softlayer Technologies: Dedicated Servers, free services & private network; Come to SoftLayer for best in class facilities, technology & customer support
WebIntellects: Tired of bait and switch hosting? Low cost gimmicks? So are we. See why we are the provider of choice in over 80 countries world-wide!
The Planet Hosting: Dedicated Server Deals: As the leading dedicated server hosting provider, The Planet always gives you the best prices on website hosting. See all our deals.
US2.net: Offers customers another choice in hosting. Our complete and Plus web hosting packages are generous in specification, with a range of essential features, but best of all at an amazing price.
IX Web Hosting.com: As low as $0.81/mo per hosted domain name! FREE Domain Registration, 200,000MB to UNLIMITED Web Space & FREE Website Builder!

Most Popular Web Hosting Searches Advertisers, Get Listed Here. 
Gogax Hosting
Gogax offers you an ALL Inclusive Premium web hosting package. INSTANT & FREE Setup. 24/7 Customer Support, MANY hosting features ... more
LYPHA.COM - Recommended
2.5TB Storage, 20TB Transfer - $3.95/mo. Free Domain Name.... more
Mochahost.com
From $3.71/mo; cPanel, Unlimited mailboxes, Free Site Builder w/ 500+ templates, PHP5, MySQL5, JSP, Ruby, SVN, 20,000 MB space & ... more



Unix/Linux Shared Hosts
Gogax Hosting
Gogax offers you an ALL Inclusive Premium web hosting ... more
LYPHA.COM - Recommended
2.5TB Storage, 20TB Transfer - $3.95/mo. Free Domain Name.... more
OKmyhosting
Offer affordable web hosting packages.5G storage and 50G ... more
Unix/Linux Dedicated Hosts
Gogax Hosting
Order Today! Servers in 60 seconds, FREE Setup, INSTANT ... more
Versaweb Hosting
Get the dedicated hosting solution you need, starting as ... more
Peer1 Network
Boost your performance online with PEER 1's award-winning ... more
Top 3 Shared Hosts
Gogax Hosting
Gogax offers you an ALL Inclusive Premium web hosting ... more
LYPHA.COM - Recommended
2.5TB Storage, 20TB Transfer - $3.95/mo. Free Domain Name.... more
IX-ONE.COM Domain Company
IX-ONE.COM is a provider of world-class products at ... more
advertisers: Get listed here
> About us
> Terms & Conditions
> Privacy Policy
> Advertising
> Contact us
> Forum Archive
> Sitemap
> RSS  RSS
RECOMMENDED BY
  Copyright © 1997-2008, Web Host Directory Ltd.  Web Hosting Directory