webhosting Web Hosting Wit.Com
Webhosting, Server and Web Site Help & Information
Internet Services
  Domain Names
  Web Hosting
  Accept Credit Cards
  SSL Certificates
  T1 Connections
 
Coding Tutorials
  HTML Tags
  HTML Code
  Style Sheets
  Javascript
  PHP Tutorial
  ASP Tutorial
  SQL (Database)
  ASP Code
  HTML Templates
 
Tips & Tricks
  Design Dos & Don'ts
  HTML Tips
  Useful Applications
  Search Engines
  My IP Lookup
 
Charts
Contact Us
Home Page
 
html basic code
free html codes
ASP
Free Coding Tutorial

What is ASP?
ASP stands for Active Server Pages. This is a side-server scripting language. It is a fantastic language that works well with simple HTML to make active and dynamically generated web sites. It can be used to make password protected web sites, set cookies, access and modify databases, send forms, emails, and more...

To use ASP pages you must be using a Windows-based server. Windows 2000 or NT servers are recommended. If you need web hosting with ASP click here to find a server or web host with the options you need.

First save your pages as .asp instead of .html because this tells the browser to open the ASP side server for ASP functions within the web page.  You will have to load the pages on a Windows-based server.

Pros and Cons
ASP follows the instructions and functions of basic (beginners advanced symbolic instruction code), so if you're already familiar with languages such as Visual Basic, using and writing ASP is easy. On the downside, ASP can only work on servers running Windows.

Getting Started
Your ASP page needs to have <%@ language=vbscript %> at the very top. Since these pages can contain both HTML and code, you need to specify which parts of it are code. <% specifies that lines of code are going to follow, and %> specifies the end of those lines of code. Code can be placed anywhere within the tags of the HTML.

Quick Reference
The following are common instructions used in programming ASP, with what they do and how to use them. Note: variable should be replaced with a unique identifier for storing values.

Cint   Converts a string value to an integer value.
variable = Cint(value)
Cstr   Converts an integer value to a string value.
variable = Cstr(value)
Date   Gets the current date from the server clock.
variable = Date
Datepart   Sets the variable to the specified part of the date where value = "M" (month), "D" (date), "YYYY" (year), "H" (hours), "N" (minutes), or "S" (seconds). date must contain a variable or value with a valid date.
variable = Datepart(value,date)
Dim   Allocates space in memory for variables. This is required for every variable.
Dim variable
Do/Loop While
Do While/Loop  
Continually executes code until a certain condition is met. For values, you can use < (less than), > (greater than), = (equal to), or <> (not equal to). For strings, only use = (equal to) or <> (not equal to).
Do
    insert code
Loop While variable = value
Do While variable = value
    insert code
Loop
For/Next/Step   Used for increasing or decreasing a variable while executing code. You can set the number of "steps" to increment or decrement the variable by setting a value for Step, though it is optional.
For variable = value 1 To value 2 Step (-)value 3
    insert code
Next
If/Then/Else/End If   This is for finding the condition of a specific variable(s). For values, you can use < (less than), > (greater than), = (equal to), or <> (not equal to). For strings, only use = (equal to) or <> (not equal to).
If variable = value Then
    insert code
Else
    insert code
End If
Left   Returns a specified amount of characters from the left portion of a string.
variable = Left(variable,value)
Mid   Returns a portion in the middle of the string, starting at character value 1, and retrieving value 2 characters.
variable = Mid(variable,value 1,value 2)
Replace   This replaces a string inside a variable with a different string.
variable = Replace(variable,string inside variable,string to replace it with)
Request.Form   Returns the value of a submitted form variable.
variable = Request.Form ("variable")
Request.Querystring   Returns the value of a variable set in a link.
variable = Request.Querystring ("variable")
Response.Redirect   This will load the address located in url. This should only be used in ASP pages not including HTML (i.e. pages updating database information).
Response.Redirect("url")
Response.Write   Writes HTML to the browser, meaning that the browser will enterpret this as if you were writing actual HTML code. This can include text, tags, header information, etc. To output the value of variables, it must be included outside the quotes.
Response.Write ("<div align=center>The length is " & variable & " meters.</div>")
Right   Returns a specified amount of characters from the right portion of a string.
variable = Right(variable,value)
Select/Case/End Select   Allows you to execute different sections of code depending on the value of a variable.
Select Case(variable)
    Case value 1
        insert code
    Case value 2
        insert code
    Case value 3
        insert code
End Select
Session   This command allows you to store values which can be accessed by other pages during an active session.
Session("variable") = value


If you have any programming tips, information, or scripts you would like to add to the site e-mail it to webmaster@webhostingwit.com

2003 Web Hosting Wit.Com and its licensors. All Rights Reserved
Designed by Fencl Web Design