ThePlace

Home ] Search ] Resources ] Site Map ] Contact Me ]
Dave's Information Technology Resource

Up ]

ASP Background ] [ Creating ASP Pages ] ASP Objects ]

--- Creating ASP Pages ---

ASP pages consist of a combination of HTML and or ASP code.  The ASP code is actually a combination of:

bulletASP objects (request, response, server, session, etc.)
bulletScript in the form of languages such as VBScript (most common), JScript, or PerlScript (via ActiveState Perl)

The following is an excerpt from an ASP/HTML page and shows some of the elements that are generally included in the page ...

<%@ Language=VBScript %>  ... directive indicating the type of script language
<% option explicit %>   ... all variables must be declared prior to use
<html>   ... standard HTML

<head>
<title>ASP Objects</title>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<h1>ASP Objects</h1>
<h2>Response and Request Objects...</h2>

<form method="POST" action="04aspobjects_copy(1).asp" name="demoform">   .... HTML form
<p><input type="text" name="inputbox" size="20"></p>     ... note the name of the HTML form object
<p><input type="submit" value="Submit" name="B1"></p>
</form>

<%  .... start of ASP code
dim inputbox 'declare a variable    ... declares variables
inputbox = request.form("inputbox")  ... get data from the form
response.write("<p>" & inputbox)   ... send data to the form
%>   .... end of ASP code

ASP pages must have the .asp extension.  

ASP pages must be executed on a server.  Generally speaking, HTML encoded content, as it is encountered, is stripped and sent directly to the clientASP code, as it is encountered, is executed and the results, if any, are sent to the client.  As the code is executed on the server, only the output is sent to the client, the raw ASP code cannot be viewed in the client.

 

 

Home ] Up ] Computer Architecture ] Programming Bootcamp ] Database Bootcamp ] Visual BasicS ] Web Basics ] Web Multimedia ] Web Programming ] Advanced Web Topics ] Developing Web Sites ] XML Technology ] Web Glossary ]

Copyright © 1999 - 2005 
ThePlace - Written and Sponsored by Dave Hillman