Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us
GPS
Free Business Cards
Prepaid Phone Card
Corporate Awards
Imprinted Gifts
KVM Switches
Home Improvement
Get Business Software
Phone Cards
Cell Phones
Desktop Computers
Promote Your Website
Find Software
Computer Deals

Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Just because Web sites are easy to build these days, that doesn't mean it's easy to build a quality Web site that meets your business objectives.

Before developing your next Web site, or redesigning an existing site, download this Internet.com eBook to guide you through the process and plan your project, whether you're developing a site in-house or outsourcing the project.
Register now for your free Internet.com membership to download your complimentary eBook. Membership will also give you access to:

eBook library         Whitepapers         Webcasts
Newsletters         WinDrivers
Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Back to Basics: VBScript for ASP

February 5, 2001

Interested in making ASP pages but do not know where to start? Learning VBScript for ASP is half the battle, check out this article to become in the know!

Introduction

I have recently received a lot of e-mails from people who understand the concepts of Active Server Pages (ASP) and the techniques discussed in other tutorials, but are getting hung up on the code. What is worse is that I almost always hear that novice ASP developers can never find resources that are simple, easy to read, and for the "just getting my feet wet" crowd. Let's face it, there are plenty of advanced resources out there, so I have decided that it is time to go back to the basics and help out those who would love to use ASP but have no idea where to begin. Welcome to VBScript 101!

VBScript is the heart of ASP. It is the scripting language that ASP defaults to and is the language I recommend that you use for all your ASP development. You can use server-side JScript, but there is no real advantage to doing so. Meanwhile, a big disadvantage is that the ASP community has pretty much standardized on VBScript. Most of the tutorials you see around the Net and in books will not even mention JScript, other then in passing. This article is going to give you a very basic understanding of using VBScript in an ASP page. Please note that this article is not going to teach you how to use VBScript to do client-side operations. Of course, there will be more overlap then not, but the intent of this article is focused on using VBScript for ASP, which should be why you are reading it the first place!

Scripting - What is It?

The big question — just what is a scripting and why should you care? Not only is it a big question, it is a good question! In very unacademic and somewhat nebulous terms, scripting is writing code that is not compiled before it is run. What does that mean? It means that unlike your standard C++ or Visual Basic type code, scripting languages like Perl, VBScript, JavaScript/JScript, and others, do not have to be run through a compiler (something that translates our human-readable code into code the machine can understand) to be executed or run. Scripting code is interpreted, or "compiled on the fly" so to speak. For instance, when you run a Perl script in a CGI-BIN directory, the script is "interpreted" by the perl "interpreter" and the results are posted back per your instructions. VBScript (which stands for Visual Basic Script) works pretty much the same way except it takes its syntax base from its parent language — the full blown and compiler dependent Visual Basic. And if you are smart, you would guess that JavaScript and JScript work the same way, originally inheriting their syntax base from Sun's Java (and more recently the standards set by ECMAScript).

Let's look at a simple client-side JavaScript as an illustrative example. Pretend you have a nice HTML page with the following JavaScript in the heading.

	<script language="JavaScript1.2" type="text/css">
	<!-- //hide from older browsers
		document.write('Hello Web World');
	//-->
	</script>

This tiny script will write "Hello Web World" on the top of the page when a user visits it. Rather then being compiled, stored and run as an executable every time a visitor hits, JavaScript (or other scripting languages) enables you to embed commands into the actual HTML that are "freshly" executed each time the page is requested. Line-by-line the code is "interpreted" and the results are, for all intents and purposes, instantaneous. One thing to note about client-side scripting is that performance is largely dependent on the client's hardware, software and connection speed. When we get into VBScript for ASP, we will be dealing with server-side scripting, so performance will be a function of the Web server we are using. For most of you it will still be your own machine!

Which leads me to a very important thing you need to know about VBScript for ASP. You need somewhere to test your code since it will not function client-side. That is where Internet Information Services (IIS) or Personal Web Server (PWS) come in. If you do not have a hosting agreement with some third-party Web host that supports ASP, you will need to configure your own PC or laptop to act as the Web server. You can do this by downloading Personal Web Server for Windows 9x or by using IIS for NT4 (can be installed with the Option Pack) and Windows 2000 (comes on the CD). These two Web servers will configure your system to have a directory on your C drive called InetPub. Underneath InetPub will be a directly called wwwroot. This directory is where you will want to store all your ASP pages. To access and test your pages you will need to point your Web browser to http://127.0.0.1/nameoffile.asp or to http://localhost/nameoffile.asp; then you are all set!

Finally, when you are testing the code illustrated below, make sure you put it in between ASP's <% '...lines and lines of vbscript... %> server-side tags. These tell the server that it should interpret the code inbetween. If you want to see the value of any variables on screen when you are testing, use <%= nameOfVariable %> and it will be displayed in your browser.

VBScript - The Easy Stuff - Page 2


Up to => Home / Authoring / ASP


IBM IT Innovation Resource Center:
WHITEPAPER:
An Architectural Blueprint for Autonomic Computing
ON DEMAND WEBCAST:
Blades Burst onto the Data Center Scene
BUSINESS VALUE ANALYZER:
IBM SOA Business Value Assessment
WHITEPAPER:
Tiered Information Infrastructure: A Practical Approach to Translating Strategy into Implementation


Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers