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
Bytehouse.co.uk: No Set Up Fees, no minimal contract, 2 Months Free on all Shared, VPS, & online backup Annual Plans, Full range of web hosting solutions, 30-day money back guarantee
Fast Hosting Direct: 2 Year No Limits UK Hosting with Free Domain & Website Builder for only £19.99 - #1 UK Budget Hosting Award Winner - No Limits on Webspace & Data Transfer - 60 Day Money Back & 99.99% Uptime Guarantee
UK2 Web Hosting from £49.99 / year: With 1 MONTH FREE! With free setup, free domains, massive space and bandwidth.
Fasthosts: Web hosting, personalised email and great value domain names all from Fasthosts - the UK's number 1 for web hosting.
Prime Hosting Ltd: UK (London) based Linux hosting with PHP, MySQL etc. Email with Spam Protection. 24/7 Support Helpdesk
£1 Web Hosting from Namesco: Great Value, Fully Featured Hosting Packages. FREE Domain Name & Google AdWords Voucher with every Hosting Plan. Fast UK Based Support.
DediPower: Dedicated to managed hosting and co-location solutions. Delivering service excellence with 27/7 support and industry leading SLA. Support with passion.
Heart Internet: Reseller Web Hosting Specialist. Host Unlimited Web Sites With Unlimited Data Transfer, Webspace and Mailboxes for £29.99 per month
NaviSite: Leverage our London data centre for Application Services and Full-Stack Hosting Solutions with 24/7 Support. NaviSite: Run with Us.
Virtual Server Warehouse: No Set Up Fees, no minimum contract, VPS from £14.99, 30-day money back guarantee and fantastic support!

Most Popular Web Hosting Searches Advertisers, Get Listed Here. 
123-reg.co.uk
1500MB data transfer, 15 POP3s, Webmail, Web stats, full FTP access... more
Bargain Host
UK Web Hosting from £0.99 pence a month, all hosting plans come with a FREE Domain Name Registration or Domain Transfer. All ... more
Lewcy UK Hosting
UK only website hosting from Lewcy, Simple, Affordable, Reliable. UK based? UK audience? Then why choose a host on the other ... more



Windows Dedicated Hosts
Rackspace
Award Winning Managed Hosting. Live Support 24-7 and a ... more
Memset Dedicated Hosting
Want the power and security of a Dedicated Server but ... more
UKHost4u.com
30 Day Free Trial on all VPS Servers. Try us today !... more
Unix Less than 500MB
123-reg.co.uk
Free domain name with web hosting only £2.99/m. Limited ... more
Bargain Host
UK Web Hosting from £0.99 pence a month, all hosting plans ... more
Lewcy UK Hosting
UK only website hosting from Lewcy, Simple, Affordable, ... more
Unix/Linux Shared Hosts
123-reg.co.uk
Free domain name with web hosting only £2.99/m. Limited ... more
Bargain Host
UK Web Hosting from £0.99 pence a month, all hosting plans ... more
Ultimate Web Hosting
Extremely cheap for Unlimited Bandwidth Web Hosting. We ... 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