Monday 21, May 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

ASP Variables

Variables are used to store the information. In ASP it is not required to declare your variables but it is a good programming practice to declare all your variables before you use them, even though it is not required. In ASP you declare a variable with the use of the Dim keyword, which is short for Dimension. Variables can be declared one at a time or all at once. Here is the example.

<%
DIM var1
DIM var2, var3
%>

Assigning values to variables:

<%
DIM var1
DIM var2, var3
var1=”Hello”
var2=100
var3=2000

response.write(var1 & “<br>”)
response.write(var2 & “<br>”)
response.write(var3 & “<br>”)

%>

Variables Lifetime:

A variable declared outside a procedure can be accessed and changed by any script in the ASP file.

A variable declared inside a procedure can be accessed and changed only in that procedure. No scripts outside the procedure can access or change the variable.

If you want to access variable in more than one ASP file, you can declare them as a session or application variable.

 
     
   
ASP Tutorial
 
  ASP Introduction
ASP Introduction
  ASP Syntax
ASP Syntax
  ASP JavaScript
ASP JavaScript
  ASP Variables
ASP Variables
  ASP Arrays
ASP Arrays
  ASP If Statement
ASP If Statement
  ASP Procedures
ASP Procedures
  ASP Functions
ASP Functions
  ASP Sessions
ASP Sessions
  ASP Cookies
ASP Cookies
  ASP Application Object
ASP Application Object
  ASP Forms
ASP Forms
  ASP Comments
ASP Comments
  ASP Email
ASP Email
  ASP ADO
ASP ADO
  ASP File
ASP File
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download Introduction to Computer Science using Java Ebook Introduction to Computer Science using Java
   
Download Unstoppable Affiliate Profits Leaked Chapters  Ebook Unstoppable Affiliate Profits Leaked Chapters
   
Download Magnetic Sponsoring Ebook Magnetic Sponsoring
   
Download Introduction to Programming (in Java) - An Interdisciplinary Approach  Ebook Introduction to Programming (in Java) - An Interdisciplinary Approach
   
Download  Internet Wealth Secrets Ebook Internet Wealth Secrets
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz