ASP Hosting sale!
1,000MB space, 40GB transfer, 1 SQL Server 2000 db! - $9.95 per month*!
Limited Time Offer!

aspdev | articles | tutorials | forums

ASPdev -> ASP Tutorial -> ASP Variables

ASP Variables

You can declare variables anywhere in your scripting blocks in your ASP pages. You can declare a variable within a Function/Sub Routine or you can declare it outside. The variables declared within a Function/Sub Routine are accessible only from this Function/Sub Routine, while the ones declared outside are accessible from everywhere in your ASP page, including any Functions/Sub Routines.

The variables declared in Function/Sub Routine exist only during the execution of Function/Sub Routine. The variables declared outside of Functions/Sub Routines exist while the APS page is executed (once the ASP page execution is completed, these variables are gone).

Sometimes you will need to have variables, which are accessible from all APS pages within one ASP application and you can accomplish that by using Session and Application variables. Well talk about the Session and Application ASP objects, later in this tutorial. For now its enough for you to know that Session variables store information about one user session (different users browsing your website will have different Session variables), while Application variables are the same for all users browsing the ASP application.




Contact Us