Home Page Icon
Home Page
Table of Contents for
Cover
Close
Cover
by Scott Mitchell
Designing Active Server Pages
Designing Active Server Pages
Preface
Who This Book Is For
How This Book Is Organized
ASP Information on the Web
Obtaining the Sample Code
Conventions Used in This Book
How to Contact Us
Acknowledgments
1. Introduction
What Is Application Design?
Designing for the Web
What’s Wrong with ASP Design?
Why Hasn’t ASP Design Advanced?
What Can Be Done to Improve ASP Design?
Server-Side Includes
File types that can perform server-side includes
Dynamic server-side includes
Naming your include files
Protecting the contents of your include files from prying eyes
More about server-side includes
VBScript Classes
Using Server.Execute
Using Server.Transfer
Further Reading
2. Choosing a Server-Side Scripting Language
The Popularity of VBScript
Specifying the Scripting Language
Specifying the Server-Side Scripting Language with SCRIPT Blocks
Choosing the Right Scripting Language
Creating ASP Pages with JScript
Statement Termination
JScript’s Variables and Datatypes
Case Sensitivity
Regular Expressions
Error Handling
An ASP Example Using JScript
Creating ASP Pages with PerlScript
PerlScript’s Variables and Datatypes
Case Sensitivity and Object Reference
Reading and Writing Files with PerlScript
Regular Expressions
Other PerlScript Features
An ASP Example Using PerlScript
Creating ASP Pages with Python
Further Reading
3. Exception Handling
A Bit of Terminology
Detecting When Exceptions Occur
Detecting Exceptions with Scripting Language Error-Handling Mechanisms
Detecting errors with VBScript
Deciding when to check if an exception occurred
Error handling in functions and subroutines
Streamlining VBScript error-handling code
Detecting errors with JScript
Nested try ... catch blocks
VBScript’s error handling versus JScript’s error handling
Detecting Exceptions with the ASPError Object
Scripting language errors
Detecting compile-time errors with the ASPError object
Internal ASP errors
External COM object errors
Responding to Exceptions
Displaying an Understandable Error Message
Notifying the Support Team When an Error Occurs
Notifying the support team with scripting language error-handling techniques
Notifying the support team with the ASPError object
Recovering from an Error
Creating Custom HTTP Error Pages
Further Reading
4. Regular Expressions, Classes, and Dynamic Evaluation and Execution
Using the RegExp Object
RegExp’s Properties
Legal Regular Expression Syntax
RegExp’s Methods
Using Object-Oriented Programming with VBScript
Object-Oriented Programming 101
An object and an instance
Encapsulating complexity
Using Classes in VBScript
Creating classes
The Initialize and Terminate events
Properties, methods, member variables, and member functions
The public and private statements
Using Property Get
Using Property Let
Using Property Set
Creating read-only or write-only properties
Creating Useful, Reusable Code
Using Dynamic Evaluation and Execution
Dynamic evaluation
Dynamic execution
Further Reading
5. Form Reuse
The Importance of Code Reuse
Code Reuse in ASP
Examining form usage
A Primer on Form Use
Creating HTML Forms
The building blocks of forms
Processing Forms Through an ASP Page
Working with the QueryString and Form collections
Form Validation
Client-Side Form Validation
Server-Side Form Validation
Creating Reusable Server-Side Form Validation Routines
Using Classes to Enhance Server-Side Validation
Further enhancements to the server-side validation class
Developing Reusable Form Creation Routines
Form Implementation Complexity
Masking Implementation Complexity Using Classes
The Practicality of Reuse
Further Reading
6. Database Reuse
Examining Database Usage
The Building Blocks for Creating Reusable Administration Pages
The Ideal Reusable Administration Page Script
Database Schemas
Importing enumerations with adovbs.inc
Importing enumerations with the METADATA tag
Opening schemas
The Criteria parameter
Creating Reusable Administration Pages
A Review of Database Terms
Primary key constraints
AutoNumber columns
Foreign key constraints
Gathering Column Information
The ColumnInformation class
The Columns class
Columns’s class properties and member variables
Columns’s class methods
Testing the Columns and ColumnInformation classes
Gathering Foreign Key Information
The ForeignKeyInformation class
The ForeignKeys class
Testing the ForeignKeys and ForeignKeyInformation classes
Deciding How to Display the Table Columns in a Form
The DataTypeFormElementInformation class
DataTypeFormElementInformation’s other methods
Testing the DataTypeFormElementInformation class
Creating the Administration Page Forms
The AdminPageGenerator class
The AdminPageGenerator member variables and properties
The AdminPageGenerator methods
The “Insert a New Record” administration page
The “Delete an Existing Record” administration page
The “Edit an Existing Record” administration page
Inserting, Updating, and Deleting Database Records
The ModifyDatabase class’s properties and event handlers
ModifyDatabase’s methods
Inserting a record into the database
Selecting a particular record to edit
Editing an existing database record
Deleting an existing database record
Tying the Administration Pages Together
MenuItem’s methods, properties, and event handlers
Testing the MenuItem class
AdminPageMenu’s properties and event handlers
AdminPageMenu’s methods
Generating a menu with the AdminPageMenu and MenuItem classes
/CODEREUSE/DisplayAdminPage.asp: the single administration page form generation script
Limitations and Possible Enhancements
A note on performance
Further Reading
7. Using Components
COM—A Quick Overview
Lesser-Known Microsoft COM Components
Creating a Random Banner Rotation System with Ad Rotator
Creating a rotator schedule file
Displaying a banner
The redirection file
Tracking banner statistics
Providing impression and click-through tracking via a class
Using the AdRotation class
Possible enhancements to the AdRotation class
Did we really accomplish anything?
Managing Web Site Content with the Content Linker
The Content Linker list file
Providing a next and previous hyperlink in each tutorial
Creating an index listing of the JScript Control Structure tutorials
Enhancing Microsoft’s COM Components
Building Components
Wrapping Business Logic Within a COM Object
Using COM Objects in a Multienvironment Scenario
Building COM Components with Script
Dissecting the Windows Script Component file
Windows Script Components versus classical, binary COM components
Further Reading
8. Enhancing Your Web Site with Third-Party Components
Executing DOS and Windows Applications on the Web Server with ASPExec
ASPExec’s Properties and Methods
Executing a Command-Line Program with ASPExec
Obtaining Detailed Information About Your Users’s Browsers
Using Microsoft’s Browser Capabilities Component
A More Versatile Solution: cyScape’s BrowserHawk
Using the BrowserHawk component
Redirecting users based on their browser’s enabled capabilities
Grabbing Information from Other Web Servers
ASPHTTP’s Properties and Methods
Retrieving a Web Page with ASPHTTP
Retrieving Binary Data with ASPHTTP
Encrypting Information
Encrypting Information with a Key
Symmetric cryptography
Asymmetric cryptography
Authentication
Digital Certificates
Client and server certificates
Sending Digitally Signed, Encrypted Email with ASPEncrypt
Obtaining the client’s certificate
Sending encrypted email
Sending digitally signed emails
Sending digitally signed, encrypted email
Uploading Files from the Browser to the Web Server
Creating a Simple “Upload a File” ASP Page
Uploading Binary Objects to a Database
Displaying a property’s pictures
Other SA-FileUp Features
Why Reinvent the Wheel?
Further Reading
Index
Colophon
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Next
Next Chapter
Designing Active Server Pages
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset