Active Server Pages
For Dummies
Introduction
Welcome to Active Server Pages for
Dummies! This book will show you how to make your Web
pages come alive and interact with the people that visit
your Web site. And the best news is that you can do it
all without having to learn mysterious and complex
computer languages or dedicating a large portion of your
life to your Web site!
If you are developing a Web site on
Windows NT, using Internet Information Server (IIS), then
youll discover how to use one of IISs most
exciting features to create truly outstanding Web sites.
But even if youre running
Windows 95 and Personal Web Server (PWS) for a small Web
or intranet site, you can still take advantage of all the
features Active Server Pages has to offer.
I Know Who You
Are. . .
If youve picked this book up
off the shelf and are flipping through it, I can make
some pretty good guesses about the kind of person you may
be.
- You may be a Web site or
Intranet developer for a company.
- You may be an individual who
has a personal or small business Web site.
- You may be a programmer who
wants to get in on all the hot new technologies.
In any case, youre probably
looking for ways to make your job easier and your Web
site a lot cooler. Id guess that:
- You know how to use Windows 95
or Windows NT and you know how to use your Web
server software -- either Internet Information
Server (IIS) or Personal Web Server (PWS), at
least well enough to get around.
- You are familiar with HTML and
have played around with some advanced tags and
maybe even other technologies like CGI or ISAPI.
- Youve had at least a
little exposure to a scripting language like
VBScript, JavaScript, Perl, or REXX.
- You may have worked with a
macro language like youd find in a
spreadsheet or other application.
- Or perhaps youve
actually done some programming in Java, Visual
Basic, C, or COBOL.
Dont worry. To get the most
out of this book you certainly dont have to be a
programmer, and you dont even have to be an HTML
guru. In fact, Active Server Pages makes activating your
Web site easy.
Why Active Server
Pages?
Active Server Pages makes it
possible to use all the power of a real computer language
right in your Web page. You dont have to write
complicated C code to interface with the Web server and
then compile it into an executable or DLL file. All you
have to do is create your HTML page, just like you
normally would, but then put your programming code right
alongside the HTML so that they work together. And
thats it! No compiling, no complex interfacing,
nothing!
This makes it easier for
programmers and non-programmers alike to update a Web
site as things change. Just bring up the page in your
favorite HTML editor, make changes to the HTML and the
code, and then save it out again. Its ready to go.
| ASP
backwards You
may think its odd that I keep saying things
like Active Server Pages makes it
possible
Shouldnt it be
Active Server Pages make it
possible
? It would certainly sound
better.
I wondered too, so I made a
pilgrimage to the English Gurus and this is what
they told me: Since the phrase Active
Server Pages is a phrase that refers to a
single technology, it is singular and takes a
singular verb.
Ive noticed that it doesnt sound so
weird when I say something like ASP makes
it possible
, so Ill often use
the abbreviation when Im referring to the
technology.
By the way, ASP can be
pronounced by saying each of the three letters
(like FBI or CIA), or simply by saying asp (like
the snake).
|
How This Book Is
Organized
This book is divided into seven
parts and each part is divided into several different
chapters. Each chapter is further broken down into
individual sections. The book explores the basics first,
and then moves on to the tougher stuff. But that
doesnt mean you have to read it in order. Feel free
to skip around or jump right to a section that has the
answer to your specific question. But if you get confused
when reading, that may be a sign that you need to go back
and pick up some of the topics discussed earlier in the
book.
Heres a list of the seven
major parts and what is discussed in each.
Part I: Getting
Started
Part I describes what Active Server
Pages are and shows you how they fit into the world of
CGI, ISAPI, ActiveX controls and all the other Internet
stuff that promises to make your Web site newer, better,
and more exiting.
Youll also figure out how to set up your computer
so that you can start creating your own Active Server
Pages. Youll even create your very first ASP page.
Part II: Speaking
Like a Native
Before you can use a programming
language to enhance your HTML pages, you have to know a
programming language. Thats what Part II is all
about. Here youll be introduced to VBScript, Visual
Basics little brother. Never written a full-blown
computer program before? Dont worry! VBScript is
probably the easiest programming language in the world.
It wont bite. I promise.
On the other hand, if youre
already familiar with programming using C, C++, Java,
JavaScript, or Perl, youll probably find JScript
(Microsoft's implementation of JavaScript) an easier
language to learn than VBScript. For you, I have written
a special chapter that gives you the quick once-over
youll need to begin writing ASP pages with JScript.
Both VBScript and JScript have exactly the same
capabilities and are completely interchangeable when
creating ASP pages. So either way, youll be ready
to jump right in.
However when I show examples
throughout the rest of this book, I dont really
want to show two listings every single time, so this is
what Im gonna do:
If you already know C, C++, Java,
or JavaScript, chances are you have some programming
experience under your belt. And Id be willing to
bet that if I showed you an example of code in VBScript,
youd probably be able to figure out what the
corresponding JScript code would be.
With that in mind, Ill do all
of my examples in VBScript. This will work for all those
who are new to programming and using VBScript. Those of
you with more programming experience can translate. In
fairness, though, if there is code that is significantly
different in JScript, Ill be sure to note it and
show you the code both ways. Fair enough?
Part III: Getting
to Know Your Objects
Adding the ability to use If..Thens
and loops to your HTML is nice, but if you cant get
information about the server, the browser, or the person
using the browser, then most of that power is going to
waste! Part III shows you how to use objects that are a
part of your Web server to get all sorts of information
and to change the way things work. It also shows you how
to take server components that you or others create and
integrate them with your ASP pages. Ah, the sweet taste
of power!
You'll also begin to discover how
all of this power can be put to use in the real world. In
Chapter 8 I'll show you how to create a Guest Book,
user-selected background music for your Web site, a
personalized Welcome page and more.
Part IV: Accessing
the Database
One of the hottest topics today is
accessing database information from a Web page. From
corporate intranets to home shopping, everyone wants to
know how to do it. In Part IV, youll learn how to
retrieve information and display it in a table as well as
how to add, update and delete records in a database from
your own ASP pages.
Part V: Really
Cool ASP Applications
All of these new capabilities are
interesting by themselves. But whats really
interesting is what happens when you start to pull
together the capabilities to create real Web
applications. In Part V, I demonstrate several complete
applications that I wrote and included on the CD-ROM in
the back of the book: a chat room, a classified ads site
and a product catalog shopping cart. I show you all the
cool stuff I did to make them work so that you can take
them and customize them to use in your own Web site.
Part VI: The Part
of Tens
The
For Dummies series of
books always includes several chapters at the end that
provide lists of ten items each, on all sorts of useful
topics. Flipping back to The Part of Tens before you read
the rest of the book is a little like eating dessert
before the main course. I highly recommend it.
ASP Me (No)
Questions...
If you want to send me feedback
about the book, Id love to hear from you! My e-mail
address is:
billhatfield@worldnet.att.net
My Web site is at:
www.edgequest.com
And for a Web site completely
dedicated to this book, check out:
www.edgequest.com/ASPDummies
Here youll find cool ASP
applications, the latest book corrections, news, and
links to other great ASP sites.
On the CD
The CD included in the back of this
book includes all the big example pages throughout this
book. It also has several other interesting things that
will help you develop ASP pages more effectively.
Go ahead and install the CD on your
computer so youll be ready to go. You can read all
about the CD's contents, the system requirements and the
installation instructions in Appendix D.
Margin Icons
| Technical
Stuff |
Sometimes I get carried
away and go off on a tangent about some technical
bit of trivia that is completely unessential to
the topic at hand. But dont worry. When I
do, I label it with this icon so that you know
that you can safely skip over it, if you want. |
| Tip |
A quick idea or technique
that will make your life a little better. |
| Warning |
When you see this icon,
always read and follow its directions. These
important bits of information can keep you from
having a very bad day. |
| Try This |
When Im exploring a
new topic, I always enjoy it more if I can
actually try it out while Im reading. So
Ive included lots and lots of little
examples throughout the book for you to try. When
you see this icon, dont just read it -- do
it! |
| Weirdness |
Sometimes things just
dont work the way any normal, rational
person would expect them to work. And its
those goofy things thatll trip you up every
time. When you see this icon, watch for weirdness
ahead. |
| On The CD |
This icon points to things
you can find on the companion CD. |
Back To Table of
Contents
|