Please visit our sponsors !
ASP Variables
A variable declared outside a procedure can be changed by any
script in the ASP file. A variable declared inside a procedure, is created and destroyed every time
the procedure is executed.
Examples
Create a variable
Variables are used to store information. This example demonstrates how to
create a variable, assign a value to it, and insert the variable value into a text.
Create an array
Arrays are used to store a series of related data items. This example
demonstrates how you can make an array that stores names.
Looping through headers
This example demonstrates how you can loop through the 6 headers in HTML.
Time-based greeting using VBScript
How to write VBScript syntax in ASP. This example will display a different
message to the user depending on the time on the server.
Time-based greeting using JavaScript
How to write JavaScript syntax in ASP. This example is the same as the one
above, but the syntax is different.
Lifetime of Variables
A variable declared outside a procedure can be accessed and changed by any
script in the ASP page in which it is declared.
A variable declared inside a procedure is created and destroyed every time
the procedure is executed. No scripts outside that specific procedure can access
or change that variable.
To make a variable accessible to several ASP pages, declare it either as a session
variable
or as an application variable.
Session Variables
Session variables store information about one single
user, and are available to all pages in one application. Common information
stored in session variables are username and userid. To create a session variable, store it in
a Session
Object.
Application Variables
Application variables are also available to all pages in one application. Application variables are used to hold information
about all users in a specific application. To create an application variable,
store it in an Application Object.
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|