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 you’ll discover how to use one of IIS’s most exciting features to create truly outstanding Web sites.

But even if you’re 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 you’ve 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, you’re probably looking for ways to make your job easier and your Web site a lot cooler. I’d 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.
  • You’ve 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 you’d find in a spreadsheet or other application.
  • Or perhaps you’ve actually done some programming in Java, Visual Basic, C, or COBOL.

Don’t worry. To get the most out of this book you certainly don’t have to be a programmer, and you don’t 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 don’t 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 that’s 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. It’s ready to go.

ASP backwards

You may think it’s odd that I keep saying things like “Active Server Pages makes it possible…” Shouldn’t 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.
I’ve noticed that it doesn’t sound so weird when I say something like “ASP makes it possible…”, so I’ll often use the abbreviation when I’m 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 doesn’t 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.

Here’s 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.
You’ll also figure out how to set up your computer so that you can start creating your own Active Server Pages. You’ll 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. That’s what Part II is all about. Here you’ll be introduced to VBScript, Visual Basic’s little brother. Never written a full-blown computer program before? Don’t worry! VBScript is probably the easiest programming language in the world. It won’t bite. I promise.

On the other hand, if you’re already familiar with programming using C, C++, Java, JavaScript, or Perl, you’ll 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 you’ll 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, you’ll be ready to jump right in.

However when I show examples throughout the rest of this book, I don’t really want to show two listings every single time, so this is what I’m gonna do:

If you already know C, C++, Java, or JavaScript, chances are you have some programming experience under your belt. And I’d be willing to bet that if I showed you an example of code in VBScript, you’d probably be able to figure out what the corresponding JScript code would be.

With that in mind, I’ll 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, I’ll 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 can’t 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, you’ll 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 what’s 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, I’d 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 you’ll 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 you’ll 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 don’t 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 I’m exploring a new topic, I always enjoy it more if I can actually try it out while I’m reading. So I’ve included lots and lots of little examples throughout the book for you to try. When you see this icon, don’t just read it -- do it!
Weirdness Sometimes things just don’t work the way any normal, rational person would expect them to work. And it’s those goofy things that’ll 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