ASP Variable
Variables are used to store information.
Try It Yourself - Examples
Generate HTML Headers with a Loop
Create Time-Based Greetings with Vbscript
Create Time-Based Greetings with JavaScript
Variable Lifetime
Variables declared outside of a subroutine can be accessed and modified by any script in the ASP file.
Variables declared within a subroutine are created and destroyed each time the subroutine is executed. Scripts outside the subroutine cannot access or modify these variables.
To declare variables that are used across multiple ASP files, declare them as session variables or application variables.
Session Variables
Session variables are used to store information for a single user and are valid across all pages in an application. Typical information stored in a Session includes name, id, and preferences.
Application Variables
Application variables are also valid across all pages in an application. Application variables are used to store information for all users of a particular application.