ASP Variables and Forms Tutorials : ASP net Variables Tutorials : ASP Forms Lessons : ASP Tutorials ASP Lessons
Graphic Design Resources Directory: Directory of Graphics Software Tutorials and All Your Graphics and Graphic Design Needs


Creative Public - Creative Graphic Design Business Resources - Graphic Design Business Resources

 All Graphic Design Resources Directory now includes Original Graphic Design Articles, Links to Hand-Picked Graphics Software Resources, Desktop Publishing (DTP) Tools, & Links to Tutorials for Image Editing Graphics Software like Adobe Photoshop or QuarXpress. And visit our most popular pages - Printing Layout Templates, Graphics Software Information, Online Design Classes, Design Schools, Graphic Design Jobs, Design & Layout Articles. If you get lost, visit our Site Map.

AddThis Social Bookmark Button

Search Design Schools

Zip Code:



Online Campus Both

home > Web Design Tutorials > Programming Tutorials > ASP Coding Tutorials > ASP Variables and Forms Tutorials


Planet Source Code - VarsFromForm - This subroutine creates a variable for each form item found on Request.Forms or Request.QueryString collections. The variable is given the same name as the form items name.

ASP 101 - Functions for Passing Variable - you're coming here directly and haven't read A Pair of Functions for Multi-Page Forms, you should do so now so you know what you're getting into. What follows is a set of extremely helpful code that should make your life a lot easier.

Variable Types Sample
This is a variable types sample article. Just when you though all variables were the same and you had finally figured the variant out--they pull you back in with variant sub-types.

Variable Name Prefixes - Good ASP code is easy to read and understand. A quick way to make your code self-documenting is to name your variables in a meaningful way. The IIS Resource Kit team has put together a list of variable name prefixes to be used with assorted data types. Using them will not only make your code easy to read, but it will also have a professional feel.

Scope out your variables
In ASP, script- or page-level variables are available across all of the code on any page for the lifetime of that page. These variables are declared outside the scope of any particular procedure or function. Procedure-level variables, on the other hand, are declared within a function or procedure and are available only within the scope of that function. That means you can access the value in the variable only within the context of its function or procedure. The code below demonstrates how to declare both script- and procedure-level variables:

Dim Even When Not Using Option Explicit - If for any reason you ever find yourself not using Option Explicit (IE: maintaining someone else's old code), you should still dimension all the variables you use. A dimensioned variable works almost twice as fast as an implicitly created variable.


Planet Source Code - VarsFromForm - This code formats the values returned by the Request object. It is not meant to replace validation in your forms but assist in converting balnk strings, null values, etc. to the proper data type for saving.

Planet Source Code - Dynamically Generate Variables - The purpose of this application is to make it easier to capture data from forms. I decided to write a way to dynamically create the request which strip the variable for apostrophes and also trims the variable

Planet Source Code - Hex Viewer
- Allows you to view the binary data of any file (GIF, JPG, ZIP, TXT, HTM, ASP) as if you were looking at a common hex viewer. Bytes are displayed as Hex characters and character data is displayed on the right.

Codefixer - Variables in ASP (VBScript) - A variable acts as a container holding or storing a value in the server computer's memory. We can then use or change the value of the variable throughout our code. Thus we could create a variable myFavouriteTeam that holds my favourite football team namely 'Spurs' and print out the value of the variable on our page. Note that to declare a variable in ASP/VBScript we use the Dim statement.

The basics of variables in ASP - Variables are vital in most every ASP script. Lets start out with the syntax for declaring a variable within a script.

Server variables - The available Server Variables vary based on the result of a combination of the browser software and the server software. They are not always exactly the same on your server and with specific browsers as documented here. There is an easy way to obtain a list. If the script is executed on a given browser, the Server Variables displayed will reflect that browser plus your server.

Code Snippet - List all session variables - This script lists all of the session variables and what the value of each session variable is in real time on your domain.

Fun with Application Variables - The following tutorial will show a simple method for setting and using Application Variables. These variables are a life saver when it comes to writing long drawn out applications that require alot of the same recordset results.

View All Variables - This single ASP page will list down all site variables. It will list down Server variables, Application variables, session variables, cookies and ASP/IIS Engine details. Very helpful for debugging.

How to get server variables - Server variables are environment variables that tell you about the environment that your application is running in. True you can find all kinds of information in the server variables.

W3Schools - ASP Variables
If the variable is declared outside a procedure it can be changed by any script in the ASP file. If the variable is declared inside a procedure, it is created and destroyed every time the procedure is executed.

Client Variable To Server - Need to get a variable from client to server? this first visit to the page has an empty string for tPass variable, after the user clicks the submit button the page re-loads itself but this time, with tPass holding a value the user enters

Server Variables Sample
The server variables ("ServerVariables") collection can be very helpful when you are developing ASP applications. As you have probably noticed in some of the other sample applications on this site, you can use the server variables collection to determine the client's browser, IP address, the current page they are viewing, the page which referred them to the current page, and many other details. The sample application(code below) listed here is a very simple app which lists all of the server variables and their current values. Note that this information varies depending on what server you are using. IIS4 has many additional variables not included in IIS3. The proper syntax to refer to a server variable in your code is Request.ServerVariables("VariableName").


AddThis Social Bookmark Button



We are looking for submissions of Graphic Design Tutorials and Articles from Knowledgeable Graphic Designers and Publishing Professionals. We will add a paragraph about your graphic design services (or other services as long as it is not offensive) along with your published article. We will add your contact information, including your graphic design business' website link, within this paragraph. gets around 16,000 Unique Visitors every day and this could mean a nice amount of traffic being sent to your graphics business' web site (or your graphic design portfolio). Find Out More Here



Please click here to visit our sponsor

Graphic Design Menu


OUR FRIENDS -- Adobe Photoshop Tutorials -- Photoshop, Flash, 3D Studio Max Tutorials -- Web Designers & Developers --Photoshop Tutorial Man -- Tutorial Guide -- Free Webmaster Tutorials -- Web Designers -- Web Design Portfolio --AllFreelanceWork--AllFreelance--Artists Helping Children --All Creative Portfolios -- All Work at Home Ideas

All Graphic Design Resources Center is always looking for more information & resources to put into our graphics directory portal. If you have any design or dtp resources that you think would fit in well, such as graphics software links, graphics and clipart foundries, objects, filters, fonts, desktop publishing or other graphic design resources articles, templates, etc...Please email us and let us know. All Graphic Design Resources Center has been around since 1998 (originally as deezin dot com), offering desktop publishing information and graphic design resources to make your web search for graphics stuff easier. Let us know how we can make All Graphic Design site more helpful for you! All informational links are hand added by an editor. Thank you for visiting our site and don't forget to bookmark this site.

R E L A T E D . L I N K S

About Us | FAQs | Contact Us | Terms of Use | Privacy Policy

All website design, text, graphics, selection and arrangement thereof, and software are the copyrighted works of Allfreelance, © 2003 - 2019 QuinStreet, Inc.