Beruflich Dokumente
Kultur Dokumente
Web pages that are customized for each user on the fly, based
upon their actions or requests. For example, new visitors to your
site can be shown a different welcome page than returning users
see, or pages in an online catalog can be queries to a database
so customers always see the most current information and
availability.
The ASP feature does not require Service Pack 2 for Windows NT
4.0, although it is recommended that all Windows NT systems
receive the Service Pack 2 updates. The ASP feature contains a
subset of the updates found in Service Pack 2.
Installation of ASP will upgrade IIS version 2.0 to version 3.0. The
other IIS 3.0 features—Index Server 1.1, Microsoft NetShow™,
FrontPage® 97 Server Extensions, and Crystal Reports—add
significant functionality to IIS, but are not required to take
advantage of ASP.
Features
What can Active Server Pages do for my business?
Active Server Pages can work with any Web browser. The output
of an ASP file is plain HTML, the content of which can be
customized for the capabilities of the client.
Implementation Questions
On which platforms does Active Server Pages run?
Active Server Pages runs in the same process as the Web Server,
handling client requests faster and more efficiently. It is much
easier to develop dynamic content and Web applications with
ASP.
1. OnStartPage
2. OnEndPage
Competition
What does Active Server Pages do better than other Web
application tools?
Michael P. Levy
Senior Consultant, Microsoft Consulting Services
April 2, 1997
Contents
Introduction
ASP Sessions Are Cookie-based
Managing ASP Sessions
Session Events
When Are Session Cookies Sent by ASP?
ASP Session ID Encryption and Session Security
SSL Encryption
Hard-to-Guess Cookie Values
User Authentication
Web Farms and ASP Session State
ASP Session Aware Load-Balancing
Introduction
One of the challenges faced by Web developers is how to create
a coherent application out of a series of independent HTML
pages. This problem is a particular concern in Web development
because HTTP is a stateless protocol. Each browser request to a
Web server is independent, and the server retains no memory of
a browser's past requests. The HTTP 1.0 protocol did not provide
a mechanism to maintain state information between requests
from a browser.
would store the string "JohnH" in the Session object and give it
the name "UserName." This value can be retrieved from the
Session object by referencing the Session object by name, as in
the following:
Cookie: ASPSESSIONID=PUYQGHUMEAAJPUYL
Session Events
ASP also provides session-specific events that can trigger your
own session initialization and clean up code. Each time a new
session begins, the procedureSession_OnStart is called. An ASP
program can use this event to perform any required session
initialization tasks. Any time a session ends, whether it was timed
out by the server, or killed by calling Session.Abandon, the
procedureSession_OnEnd is called. An ASP program can use this
event to perform any session cleanup that is required.
SSL Encryption
Encrypting all communications between the browser and the
server will prevent hackers from capturing the session cookie.
Using SSL, all traffic—including the session cookies—are
encrypted. A hacker sniffing or monitoring the network will not be
able to see the private cookies in use. When using SSL
encryption, remember that all browser requests to the Web
application directory will include the session ID cookie. Even
requests for static HTML content in the same directory tree as the
ASP pages will include the session ID cookie. All requests to the
virtual directory, not just for ASP files, must be encrypted.
User Authentication
If the combination of SSL encryption and the complexity of the
ASP cookie generation algorithm do not meet your security
requirements, user authentication and client certificates can be
used in conjunction with session management to provide secure
Web applications with client authentication.
<% Response.Redirect("http://w10.sample.com/Webapp/firstpage.asp"
%>
The browser will request the specified page, and can run the
application. The only requirement is that all URLs embedded in
each page (as hyperlinks or form actions) should be relative
URLs, for example:
<FORM METHOD="POST"
ACTION="ProcessForm.ASP"></FORM>
<A HREF="nextpage.asp">
While the user is using the application, all requests will return to
the same Web server on which the session is running. This
technique may not be appropriate for all Web applications. If
users save URLs using favorites or bookmarks, they may save a
URL to a specific machine and when they return for a new
session, they will not be properly load-balanced.
The Session_OnStart logic can choose to accept these requests
or intelligently return the user to the well-known URL
(http://example.microsoft.com/Webapp/) for load-balancing. This
is only an example technique to allow ASP session management
to work in a Web farm. Other methods are available. You don't
have to do it using a redirect; you can get the same effect by
using full URLs in your start page that specify the server the
session is on.
Microsoft Corporation
Updated December 27, 2000
Summary: This two-module tutorial provides a step-by-step
introduction to several ASP features. The tutorial shows how to
build sample applications and demonstrates key concepts you'll
need to understand when developing your own ASP pages. (11
printed pages)
Welcome to the Active Server Pages (ASP) tutorial. If you are new
to Microsoft® Internet Information Services (IIS), this introduction
provides necessary information about tutorial directory structure
and permission issues. The two tutorial modules show you how to
build sample applications, while demonstrating key concepts
you'll need to understand when developing your own ASP pages.
We suggest you work through each lesson in Module One before
starting Module Two.
As you work through the lessons in each module, save your work
in the C:\Inetpub\Wwwroot\Tutorial directory to view the content
on your Web site. If you did not customize your installation of IIS,
C:\Inetpub\Wwwroot was created as the default home directory.
To load and run the tutorial samples, you must have
administrator privileges on the computer running IIS. The default
IIS security settings should allow you to run the tutorial, but you
may need to change your security settings on the directory if you
encounter access violations. See the product documentation for
more information about IIS security settings.
Module One
This module explains how to create ASP pages (.asp files) that
use the fundamental features of HTML, ASP, and VBScript. This
module includes the following lessons:
• Write and Run an ASP Page. Describes how to use Visual
Basic® Scripting Edition (VBScript) and HTML tags.
• Send Information by Using Forms. Shows how to display
forms on an HTML page.
• Create a Guest Book. Uses forms to gather information from
visitors, store the information in a database, and display the
database contents in a Web page.
• Display an Excel Spreadsheet in ASP. Explains how to
display an Excel spreadsheet in a Web page.
The best way to learn about ASP pages is to write your own. This
lesson covers VBScript syntax and coding samples. To create an
ASP page, use a text editor to insert script commands into an
HTML page. Saving the page with an .asp file name extension
tells the Web server how to process the script commands. To
view the results of a script, request the page using a Web
browser. VBScript is the default scripting language for ASP, and
most of the examples in the tutorial are scripted in VBScript.
<example>
<%example%>
You can put many tags inside one pair of VBScript delimiters:
<%example, samples%>
Example 1
Example 2
This example incorporates a FOR loop in the ASP page. The FOR
loop is a statement that prints "Hello World" 10 times. To create
Example 2, use the file from Example 1 and add the FOR loop
code as shown in the following code sample. Save the file as
Example2.asp. View it in your browser.
Example 3
Example 4
Button example
In this example, there are three input lines that use "buttons,"
and two default buttons-RESET and SUBMIT. The Post method is
used to send data from the client browser to the Web server.
Open your text editor, create a new file, and paste in the
following code. Save the file as Button.htm and view the page in
your browser.
<html>
<head>
<title>Button Form</title>
</head>
<body>
<FORM NAME="Button Example" METHOD="POST" ACTION="tutorial/button.htm">
Computer Programming Experience:
<P>
<INPUT TYPE="button" NAME="choice" VALUE="Less than 1">Less
than 1 year.<BR>
<INPUT TYPE="button" NAME="choice" VALUE="1 to 5">1-5 years.<BR>
<INPUT TYPE="button" NAME="choice" VALUE="More than 5">More
than 5 years.
</P>
<P><INPUT TYPE="reset" VALUE="Clear Form">
<INPUT TYPE="submit" VALUE="Submit">
</P>
</form>
</body>
</html>
Text example
In this example, you create text fields in a form. Open a new file
in your text editor, paste in the following code, and save the file
as Text.htm:
<html>
<head>
<title>Text Form</title>
</head>
<body>
<FORM NAME="Text Example" FORM METHOD="POST" ACTION="tutorial/text.htm">
<TABLE>
<TR>
<TD ALIGN="RIGHT" VALIGN="MIDDLE">Name?
<TD ALIGN="LEFT">
<INPUT TYPE="text" NAME="name" VALUE=""
SIZE="20" MAXLENGTH="150">
<TR>
<TD ALIGN="RIGHT" VALIGN="MIDDLE">Company?
<TD ALIGN="LEFT">
<INPUT TYPE="text" NAME="company" VALUE=""
SIZE="25" MAXLENGTH="150">
<TR>
<TD ALIGN="RIGHT" VALIGN="MIDDLE">
Email Address?
<TD ALIGN="LEFT">
<INPUT TYPE="text" NAME="email" VALUE=""
SIZE="25" MAXLENGHT="150">
</TABLE>
<INPUT TYPE="reset">
<INPUT TYPE="Submit" NAME="Submit" VALUE="Submit">
</form>
</body>
</html>
After you create the database, you need to create a data source
name (DSN) connection to the database so your ASP application
can interact with it. The DSN must be created on the Web server
that is running the ASP application. If you move the ASP
application to a different Web server, you have to re-create the
DSN on the new Web server. The following procedure describes
how to create a DSN on Windows NT and Windows 2000.
Now that you have created the database and the DSN, paste the
following code into a file named Guestbook.asp and place it in the
C:\Inetpub\Wwwroot\Tutorial directory.
Once you have created the spreadsheet and named the table in
the spreadsheet, and also created a DSN for the spreadsheet, you
are ready to create the page that displays the contents. Paste the
following code into a new file and name it ASPTOC.asp. Save it in
the C:\Inetpub\Wwwroot\Tutorial directory and view the page in
your browser.
<%@Language=VBScript %>
<html>
<head>
<title> Displaying An Excel Spreadsheet in an Web Page </title>
</head>
<body bgcolor="#FFFFFF" text="#000000" >
<h1>ASP Table of Contents</h1>
<%
'Creates an instance of an Active Server Component
Set oConn = Server.CreateObject("ADODB.Connection")
'Connects to the Excel driver and the Excel spreadsheet
'in the directory where the spreadsheet was saved
strConn = "Driver={Microsoft Excel Driver (*.xls)};
DBQ=C:\Inetpub\Wwwroot\Tutorial\ASPTOC.xls;"
'Opens the connection to the data store
oConn.Open strConn
'Selects the records from the Excel spreadsheet
strCmd = "SELECT * from `ASPTOC`"
Set oRS = Server.CreateObject("ADODB.Recordset")
'Opens the recordset
oRS.Open strCmd, oConn
'Prints the cells and rows in the table
Response.Write "<table border=1><tr><td>"
'Gets records in spreadsheet as a string and prints them in the table
Response.Write oRS.GetString (, , "</tr><td>", "</td></tr><tr><td>",
NBSPACE)
%>
</body>
</html>
Module Two
This module explains how to develop an ASP page that delivers
services useful in e-commerce. This module includes the
following lessons:
Count Page Hits. Track the number of times users request a page.
Rotate Ad Information
Test the Ad Rotator. Uses an ASP page that calls the Ad Rotator
logic Include file and the image data file to display and rotate
ads.
Open a new file in your text editor, paste in the following script,
and save the file as Adrotatorlogic.inc:
<%
Function getAd()
Dim load
getAd = load.GetAdvertisement("adimagedata.txt")
End Function
%>
The data file is divided into two sections that are separated by an
asterisk (*). The first section provides information common to all
the ads to be displayed. The second section lists data relevant to
each ad.
Open a new file in your text editor, paste in the following script,
and save the file as Adimagedata.txt:
REDIRECT adrotatorredirect.asp
WIDTH 250
HEIGHT 60
BORDER 0
* ' separates the general data from the image information
images/windows_logo.gif
http://www.microsoft.com/windows
Microsoft Windows
2
images/office_logo.gif
http://www.microsoft.com/office
Office 2000
3
To test the system, you will need an ASP page that calls the Ad
Rotator Include file and the ad images data file, and then displays
the ads. First, you will need test ad images stored on your site.
When a user clicks the ad, the browser appends a query string to
the request to the server. Then, the server directs the user's
browser to the ad's URL.
Open a new file in your text editor, paste in the following script,
and save the file as Adrotatorredirect.asp:
<%@Language=VBScript %>
<html>
<head>
<title>Redirection Page</title>
</head>
<body>
<%
'Set the response buffer on
Response.Buffer = True
Dim lsURL
'Obtain the URL from the query string
lsURL = Request.QueryString("URL")
'Clear the response and redirect to URL
Response.Clear()
Response.Redirect(lsURL)
%>
</body>
</html>
It is important to know how many hits your Web pages get. This
data helps determine how changes to your Web site may affect
your customers' viewing habits. More importantly, it provides
useful insight as to how customers are navigating through your
site and where ads should be placed. Sites with high trafficking
have higher advertisement prices associated with them. The data
gathered from a page hit counter provides you with trafficking
information to begin negotiating advertisement prices for your
Web pages.
• Hits(). This displays the number of hits for a Web page. The
default is the current page.
• PageHit(). This increments the hit count for the current
page.
• Reset(). This resets the hit count for a page to zero. The
default is the current page.
An in-use sample of this script can be seen at the bottom of the
Displayad.asp script. To place a page hit counter on a Web page,
place the following script where you want the counter displayed
on the page:
ASP Conventions
Contents
Introduction
Using ASP in IIS
ASP Application Directory Structure
Filename Extension Standards
Connection Pooling
Visual Basic Applications as DLLs
Object and Variable Initiation
VBScript Conventions
HTML Conventions for ASP Pages
Introduction
The authors of the IIS Resource Kit have produced this document
on ASP authoring conventions for Web developers. These
conventions for developing Active Server Pages (ASP) promote
script efficiency (fast application execution), efficient use of
server resources, and consistent styles. These conventions are
adapted from Appendix B, "ASP Standards" of the Internet
Information Server Resource Kit, published by Microsoft Press,
1998. The Resource Kit provides a wealth of information on ASP
application development.
The ASP standards document (in HTML and Word format) is
offered to assist with the adoption of ASP in your organization. If
you have requirements to create standards before deploying new
technologies, you can edit this document to fit your specific
standards styles and adapt it to fit your in-house standards
documentation.
/Application_Root
Default.htm
Global.asa
/Classes
/Content
/Media
/Themes
/Data
/DLLs
• Default.htm
• Global.asa
/Classes Directory
The /Classes directory holds Java classes used by the application.
/Content Directory
The /Content directory holds all .htm files and all .asp files that
may be run by a user of the site. The /Content directory has
execute permissions. Keeping all scripted pages in this directory
branch simplifies permissions management.
/Media Sub-directory
/Themes Sub-directory
/Data Directory
/DLLs Directory
Helper Files
Helper files are include files or text files that make information
available across the application. For security reasons the
directory containing helper files should not be stored in the
published Web space (the Web site directories identifiable to
users).
Standards:
You must use the .asp extension for pages that contain ASP
scripts. To save time and resources when serving pages, use
the .htm extension for files that don't require server-side script
execution.
Standards:
Connection Pooling
One of the potential bottlenecks in ASP application performance
is connection management. If not managed properly, the opening
and closing of connections can happen too frequently and can
cause reduced server performance. Windows NT Server 4.0
features built-in support for Connection Pooling, maintaining
connections optimally to achieve faster application performance
and graceful timeout management with less coding effort.
Visual Basic 5.0 should be used to create an ActiveX DLL that has
its project properties set to Run in Unattended
Mode, Apartment Model Threaded, andMulti-instance.
Object and Variable Initiation
The following discussion focuses on initializing and setting
dimensions for objects and variables to achieve speed of
execution and efficient use of server resources.
VBScript Conventions
The following suggested conventions apply to the development of
ASP scripts written in Microsoft Visual Basic Scripting Edition
(VBScript) and are designed to enhance consistency,
performance, and reliability.
Comments in Scripts
If...Then...Else...Endif
Constant Names
Const MIN_QUAL = 25
Use the Dictionary object when you have set a high priority on
fast searches of nonlinear data.
Instead of this:
Do this:
<%
strEmail = Session("Email")
strFirstName = Request.Form ("FirstName")
strLastName = Request.Form ("LastName")
%>
Save the resources used by IIS to process scripts for pages not
using session state information by setting the Enable Session
State directive to FALSE for those pages:
Language Default
• Specify language.
• Use Option Explicit statement.
• List function library includes.
• Declare page-scoped variables.
• Assign values to page-scoped variables.
• Code HTML and in-line scripting.
• List functions called by in-line scripts.
In general, use blank lines sparingly. You should remove all blank
lines at the beginnings and ends of files, but may want to include
one blank line between statements, to increase readability.
Object Naming
Spaces in Scripts
To enhance script readability, use spaces consistently:
Statement Styles
If...Then...Else...End If statements:
• Capitalize the first letter of If, Then, Else, and End If.
• Indent the clauses two spaces, or one tab.
• Put spaces at each end of an equal sign.
• Avoid using unnecessary parentheses.
Correct example:
<%
If Request("FName") = "" Then
Response.Clear
Response.Redirect "test.html"
Else
Response.Write Request("FName")
End If
%>
Sub SessionOnStart
Set Session("MyId") = Request.ServerVariables(...)
End Sub
FirstName
String Concatenation
String Function
For I = 0 to 11 . . .
Case Values
Trimming Values
Variable Declaration
When you want to use strong variable typing, the logic should be
programmed into a component built with a language that
supports it, such as Visual Basic 5.0 or Visual J++. Loosely typed
variables, such as Variants in VBScript, can affect performance,
especially when mathematical computations are involved.
Variable Names for Consistency
Boolean bln
Byte byt
Collection col
object
Currency cur
Date-time dtm
Double dbl
Error err
Integer int
Long lng
Object obj
Single sng
String str
User-defined udt
type
Variant vnt
ADO cnn
connection
Instead of:
strSocialSecurityNumber
Use:
StrSSN
You should check and debug your HTML code formally, using
either a dedicated HTML checker or an HTML editor that includes
a checker.
For usability with small screens, keep the average line of text to
approximately 12 words.
<OBJECT ID="ShockedPMDauntless">
CLASSID="clsid:59CCB4A0-727D-11CF-AC36-00AA00A47DD2"
CODEBASE="http://www.fabrikam.com/marketing/movers/..."
WIDTH=180 HEIGHT=120
>
<PARAM NAME="swURL" VALUE="dauntless.dcr">
<EMBED SRC="dauntless.dcr" ALT="Movie of Fabrikam
Dauntless model in
action" WIDTH=180 HEIGHT=120>
</EMBED>
<NOEMBED>
<IMG SRC="dauntless.gif" ALT="Picture of Fabrikam
Dauntless model in
action" WIDTH=180 HEIGHT=120>
</NOEMBED>
</OBJECT>
ASP from A to Z
Introduction
There's lots of helpful information about Active Server Pages
(ASP) available on this site and other sites. If you have plenty of
time to search for the information, you can find answers to most
of your questions. But if you want to find out what tools you can
use to debug ASP or how to handle errors, you need to do some
digging. This article provides an easy way to find information that
pertains to ASP, including a short definition of what ASP is, how
ASP works, and an alphabetical list of terms and tips that relate
to ASP. In the A-to-Z list, you will see a brief description as well as
pertinent links to more detailed information (when that
information is available). This article is meant to be a "living"
document. That means that I plan on updating it with new tips
and removing tips that no longer apply. If you are an ASP
developer and have a "juicy" tip, send it to me. If I publish it here,
you'll get credit and the everlasting gratitude of throngs of other
ASP developers.
What ASP Is
Active Server Pages is a programming environment that provides
the ability to combine HTML, scripting, and components to create
powerful Internet applications that run on your server. If you are
already creating Web sites that combine HTML, scripting, and
some reusable components, you can use ASP to glue these items
together. You can create an HTML interface for your application
by adding script commands to your HTML pages and you can
encapsulate your business logic into reusable components. These
components can be called from script or other components.
1. The user brings up a Web site (like MSDN Library) where the
default page has the extension .asp.
2. The browser requests the ASP file from the Web server.
3. The server-side script begins to run with ASP.
4. ASP processes the requested file sequentially (top-down),
executes any script commands contained in the file, and
produces an HTML Web page.
5. The Web page is sent to the browser.
Because your script runs on the server, the Web server does all of
the processing and standard HTML pages can be generated and
sent to the browser. This means that your Web pages are limited
only by what your Web server supports. Another benefit of having
your script reside on the server is that the user cannot "view
source" on the original script and code. Instead, the user sees
only the generated HTML as well as non-HTML content, such as
XML, on the pages that are being viewed.
ASP from A to Z
This section contains a list of terms and tips to help you
understand ASP. They are listed in alphabetical order. Scroll down
to the topic that interests you or click the letter in the alphabet
below to jump down to the section containing the topic. I cribbed,
er, I mean, compiled these tips and definitions from a number of
sources, including technical articles (listed in the bibliography
below), Knowledge Base articles, and a beta version of the
Microsoft® Internet Information Server (IIS) 5.0 documentation
(I'm so lucky!).
A B C D E F G I J L M O P
Q R S T V W X
ADO
Applications
Bottlenecks
Browser Connection
Buffering
C++
Caching
Client-Side Scripts
Components
Connections
CPU
Database
Use ADO for adding database access to your Web pages via
components. ADO can be used to create small components that
connect to any OLE-DB compliant data source, whether it's
relational or non-relational. This includes spreadsheets,
databases, or e-mail directories.
Debugging
Dictionary Object
The Dictionary object enables you to look up and store arbitrary
key-data pairs rapidly. The Dictionary object gives you access to
items in the array by key, so it is faster to find things that aren't
stored contiguously in memory. Instead, you use a key rather
than having to know where in the array the object is stored.
Disconnected Recordsets
Error Handling
Flow Control
Flow control is the ability to set the flow of your ASP application.
Flow is controlled through Response methods and two
new Server methods (for IIS 5.0).
Using Response.Redirect causes posted data to be lost.
The Response.Endmethod causes ASP to stop when an error is
found. You do not need to call this method after
calling Response.Redirect. The Server.Transfer method is the
same as Response.Redirect, except that the work is done on
the server and posted data is not lost.
The Server.Execute method will flow into a nested ASP call and
return execution to where you were before the error occurred.
FileSystem Object
Global.asa
Glue
Use ASP for the glue and components for the business logic. If
you have 100 or more lines of consecutive script, turn it into a
component using server scriptlets (bearing in mind that server
scriptlets have the same limitations as Visual Basic components).
InetLoad
The InetLoad tool can be used to tune your Web site. This tool
generates customizable loads on various Internet services, over a
broad range of Internet protocols, including HTTP, SMTP, POP3,
and LDAP. You can use this tool to simulate traffic on your Web
site. InetLoad is available
athttp://www.thaiware.com/software/internet/IN00470.htm. See
also WCATW and Mercury LoadRunner for tuning tools.
Internationalization
If you are providing a Web site that will be viewed in countries
other than the United States, you can use the CODEPAGE tag
within the <% %> delimiters to specify the proper code page.
Alternatively, you can use the Session.CodePageproperty. Read
all about it
athttp://www.microsoft.com/workshop/server/nextgen/nextgen
.asp. In addition to CODEPAGE, you can also use the Local
Language Identifier (LCID) to determine the language that the
user has set as her preference. Detailed information about LCID
can be found in the IMultiLanguage Reference.
Isolation
Java
Use Java (or C++) to write components. Java is a powerful
language that you can use to create components that are both-
threaded.
Logging
You can also log to the Windows NT® Server Event Log; however,
logging to the Windows NT Server Event Log is not a good idea if
you've got lots of errors or are in debugging mode because you
can fill up the log quickly. Using the Windows NT Performance
Monitor, you can log a variety of error conditions, including how
many ASP requests have failed and how many errors occurred
during the script run-time.
<OBJECT> tag
Option Explicit
Turn on the Option Explicit option in your .asp file. Visual Basic
enables you to use variables without explicitly declaring them.
Turning on this option helps to identify undefined variables—you
will get an error message for undefined variables. Turning on
Option Explicit makes undeclared variables illegal. Undeclared
local variables are as slow as global variables. Turning on this
option will help you find these slugs so that you can get them out
of your code.
Order of Execution
Performance Monitoring
Queuing
Restarting IIS
Scalability
Break your include files into multiple small files rather than
having one large file, and include only those files required by
your server-side script. If the file that your ASP script includes
contains a large number of functions and variables that are not
used by the including script, you can waste resources and
adversely affect performance and scalability.
Scripting Engines
Scripting Languages
Security
You can create server-side script using ASP that extracts a user's
client certificate and saves the information. You can then use
Secured Sockets Layer (SSL) to catalog and manage the
certificates of users accessing your server. Read more about
implementing a secure site with ASP
athttp://www.microsoft.com/isn/whitepapers/security.asp.
Self-Tuning
A new feature for IIS 5.0 enables ASP to detect when executing
requests are blocked by external resources, and to automatically
provide more threads to simultaneously execute additional
requests and continue normal processing. If the CPU becomes
overburdened, ASP cuts down on the number of threads to
reduce thread-switching on simultaneous non-blocking requests.
Server Performance
Server Scriptlets
In IIS 5.0, ASP supports server scriptlets. Now you can turn your
business logic script procedures into reusable COM components
that you can use in your Web applications, as well as in other
COM-compliant programs.
Service Packs
Be sure to get the latest service pack for IIS and ASP. You can
find information about service packs on the IIS site
athttp://www.microsoft.com/ntserver/web/default.asp.
Sessions
Session Loss
Serialized
SQL Server
Templates
Testing
Test your ASP. Use the tools available with IIS and Visual InterDev
6.0 to test your script and components.
Threads
Use objects that are marked as "both" for the threading model in
your ASP file, if you plan to store those objects in session or
application state. Objects marked "both" or "apartment" will give
you the best performance for objects that are within the scope of
the page. ASP does not guarantee that your session will run on a
particular thread. If you use an apartment-threaded component,
that component will always run on the same thread. Components
that are both-threaded can run on any thread. In simple terms:
Let's say that you are at a supermarket. You notice that checkout
line number three has only one person in line while the other
checkout lines are long. You choose checkout line number three.
If you come back to the store later, you might see that checkout
line number three now has a very long line, so you'd prefer to go
to another checkout that has a shorter line. If you are apartment-
threaded, you can't go to another line; you must go back to the
thread that created you.
Readhttp://www.microsoft.com/workshop/server/components/agili
ty.asp for more information about threading and ASP
components.
Transactions
Tools
Type Libraries
Validation
Visual InterDev
WCAT
Web Farms
XML