 |  | |
ASP Tutorial/Guide/Help
Active Server Pages (ASP) are Web pages that contain server-side scripts in addition to the usual mixture of text and HTML (Hypertext Markup Language) tags. Server-side scripts are special commands you put in Web pages that are processed before the pages are sent from your Personal Web Server to the Web browser of someone who's visiting your Web site. When you type a URL in the Address box or click a link on a Web page, you're asking a Web server on a computer somewhere to send a file to the Web browser (sometimes called a "client") on your computer. If that file is a normal HTML file, it looks exactly the same when your Web browser receives it as it did before the Web server sent it. After receiving the file, your Web browser displays its contents as a combination of text, images, and sounds.
ASP is the future of the web. If you're looking for a way to create attractive, intelligent web pages or, if you're just looking for a way to extend your HTML know-how, then ASP is an effective way to achieve your goals. With ASP, you can customize your web pages to be more dynamic, more efficient and more responsive to your users. It's not just a technology, though ¡ª to get the best out of ASP, you'll be using it in tandem with HTML, and with one or more of the web's simple scripting languages.
In the case of an Active Server Page, the process is similar, except there's an extra processing step that takes place just before the Web server sends the file. Before the Web server sends the Active Server Page to the Web browser, it runs all server-side scripts contained in the page. Some of these scripts display the current date, time, and other information. Others process information the user has just typed into a form, such as a page in the Web site's guestbook. To distinguish them from normal HTML pages, Active Server Pages are given the ".asp" extension.
What Can You Do with Active Server Pages?
There are many things you can do with Active Server Pages. You can display date, time, and other information in different ways. You can make a survey form and ask people who visit your site to fill it out, send emails, save the information to a file, etc.
What Do Active Server Pages Look Like?
The appearance of an Active Server Page depends on who or what is viewing it. To the Web browser that receives it, an Active Server Page looks just like a normal HTML page. If a visitor to your Web site views the source code of an Active Server Page, that's what they see: a normal HTML page. However, the file located in the server looks very different. In addition to text and HTML tags, you also see server-side scripts. This is what the Active Server Page looks like to the Web server before it is processed and sent in response to a request.
The Active Server Pages (ASP) framework provides six built-in objects:
Application
ObjectContext
Request
Response
Server
Session
The Active Server Pages(ASP) always works with Javascript and Vbscript and Html Language, Javascript and Vbscript are script languages.
Javascript
Vbscript
Html
Application Object:
You can use the Application object to share information among all users of a given application. An ASP-based application is defined as all the .asp files in a virtual directory and its subdirectories. Because the Application object can be shared by more than one user, there are Lock and Unlock methods to ensure that multiple users do not try to alter a property simultaneously.
Syntax:
Application.method
Collections:
Contents
StaticObjects
Methods:
Lock
Unlock
Events:
Application_OnEnd
Application_OnStart
Example:
Application.Lock
Application("NumVisits") = Application("NumVisits") + 1
Application.Unlock
ObjectContext Object:
You can use the ObjectContext object to either commit or abort a transaction, managed by Microsoft Transaction Server (MTS), that has been initiated by a script contained in an ASP page.
Syntax:
ObjectContext.method
Methods:
SetComplete
SetAbort
Events:
OnTransactionCommit
OnTransactionAbort
Request Object:
The Request object retrieves the values that the client browser passed to the server during an HTTP request.
Syntax:
Request[.collection|property|method](variable)
Collections:
ClientCertificate
Cookies
Form
QueryString
ServerVariables
Properties:
TotalBytes
Methods:
BinaryRead
Response Object:
You can use the Response object to send output to the client.
Syntax:
Response.collection|property|method
Collections:
Cookies
Properties:
Buffer
CacheControl
Charset
ContentType
Expires
ExpiresAbsolute
IsClientConnected
Pics
Status
Methods:
AddHeader
AppendToLog
BinaryWrite
Clear
End
Flush
Redirect
Write
Server Object:
The Server object provides access to methods and properties on the server. Most of these methods and properties serve as utility functions.
Syntax:
Server.property|method
Properties:
ScriptTimeout
Methods:
CreateObject
HTMLEncode
MapPath
URLEncode
Session Object:
You can use the Session object to store information needed for a particular user-session. Variables stored in the Session object are not discarded when the user jumps between pages in the application; instead, these variables persist for the entire user-session. The Web server automatically creates a Session object when a Web page from the application is requested by a user who does not already have a session. The server destroys the Session object when the session expires or is abandoned.
Syntax:
Session.collection|property|method
Collections:
Contents
StaticObjects
Properties:
CodePage
LCID
SessionID
Timeout
Methods:
Abandon
Events:
Session_OnEnd
Session_OnStart
About Javascript Language:
What is Javascript?
JavaScript in Navigator
JavaScript in LiveWire
JavaScript, the language
Javascript Object
Javascript Object Property
Javascript Method
Javascript Event Handler
Javascript Syntax
Javascript Reservation Keywords
About Vbscript Language:
What is Vbscript?
VBScript Functions
VBScript Constants
Errors
Events
VBScript Keywords
Methods
Objects and Collections
Operators
Properties
Statements
What is Javascript?
JavaScript is Netscape's cross-platform, object-based scripting language for client and server applications. There are two types of JavaScript:
JavaScript in Navigator:
Netscape Navigator 2.0 (and later versions) can interpret JavaScript statements embedded in an HTML page. When Navigator requests such a page, the server sends the full content of the document, including HTML and JavaScript statements, over the network to the client. The Navigator then displays the HTML and executes the JavaScript, producing the results that the user sees. This process is illustrated in the following figure.
Client-side JavaScript statements embedded in an HTML page can respond to user events such as mouse-clicks, form input, and page navigation. For example, you can write a JavaScript function to verify that users enter valid information into a form requesting a telephone number or zip code. Without any network transmission, the HTML page with embedded JavaScript can check the entered data and alert the user with a dialog box if the input is invalid.
JavaScript in LiveWire:
LiveWire is an application development environment that uses JavaScript for creating server-based applications similar to CGI (Common Gateway Interface) programs. In contrast to Navigator JavaScript, LiveWire JavaScript applications are compiled into bytecode executable files. These application executables are run in concert with a Netscape server (version 2.0 and later) that contains the LiveWire server extension.
The LiveWire server extension generates HTML dynamically; this HTML (which may also include client-side JavaScript statements) is then sent by the server over the network to the Navigator client, which displays the results.
JavaScript, the language:
As described in the previous sections, client and server JavaScript differ in numerous ways, but they have the following elements in common:
Keywords, statement syntax, and grammar
Rules for expressions, variables, and literals
Underlying object model (although Navigator and LiveWire have different object frameworks)
Built-in objects and functions
Javascript Object:
Each object topic indicates whether the object is part of the client (in Navigator), server (in LiveWire), or is common (built-in to JavaScript). Server objects are not included in this version of the documentation. The following objects are available in JavaScript:
anchor
applet
button
checkbox
Date
document
form
history
link
location
Math
password
radioButton
reset
selection
string
submit
text
textArea
window
Javascript Object Property:
The following objects Property are available in JavaScript:
action
alinkColor
anchors
bgColor
checked
current
defaultChecked
defaultSelected
defaultStatus
defaultValue
E
elements
fgColor
forms
frames
hash
host
hostname
href
index
lastModified
length
linkColor
links
LN2
LN10
loadedDate
location
method
name
options
parent
pathname
PI
port
protocol
referrer
search
selected
selectedIndex
self
SQRT1_2
SQRT2
status
target
text
title
top
value
vlinkColor
window
Javascript Method:
The following Methods are available in JavaScript:
abs
acos
alert
anchor
asin
assign
atan
back
big
blink
blur
bold
ceil
charAt
clear
clearTimeout
click
close
confirm
cos
eval
exp
fixed
floor
focus
fontcolor
fontsize
forward
getDate
getDay
getHours
getMinutes
getMonth
getSeconds
getTime
getTimeZoneoffset
getYear
go
indexOf
italics
lastIndexOf
link
log
max
min
open
parse
pow
prompt
random
round
select
setDate
setHours
setMinutes
setMonth
setSeconds
setTimeout
setTime
setYear
sin
small
sqrt
strike
sub
submit
substring
sup
tan
toGMTString
toLocaleString
toLowerCase
toString
toUpperCase
UTC
write
writeln
Javascript Event Handler:
The following Event Handler are available in JavaScript:
onBlur
onChange
onClick
onFocus
onLoad
onMouseOver
onSelect
onSubmit
onUnload
Javascript Syntax:
JavaScript statements consist of keywords used with the appropriate syntax. A single statement may span multiple lines. Multiple statements may occur on a single line if each statement is separated by a semi-colon.
Syntax conventions: All keywords in syntax statements are in bold. Words in italics represent user-defined names or statements. Any portions enclosed in square brackets, i.e. [ and ], are optional. {statements} indicates a block of statements, which can consist of a single statement or multiple statements delimited by a curly braces.
The following statements are available in JavaScript:
break
comment
continue
for
for...in
function
if...else
return
var
while
with
Javascript Reservation Keywords:
The following Keywords can't be use as variable or function name or object name in javascript language:
abstract
boolean
break
byte
case
catch
char
class
const
continue
default
do
double
else
extends
false
final
finally
float
for
function
goto
if
implements
import
in
instanceof
int
interface
long
native
new
null
package
private
protected
public
return
short
static
super
switch
synchronized
this
throw
throws
transient
true
try
var
void
while
with
What is Vbscript?:
VBScript (short form of Visual Basic Script Edition) is an Active Scripting engine bundled with Microsoft Windows. It uses a dialect of Visual Basic (essentially a subset of VB language with a few added features). VBScript can be used in Internet Explorer, Active Server Pages and Windows Script Host as a general-purpose scripting language. It is often used in conjunction with Windows Script Host as a replacement for batch files.
VBScript is interpreted by a script engine vbscript.dll, which can be invoked by ASP engine asp.dll in a web environment, wscript.exe in a Windows GUI environment, and cscript.exe in a command-line environment. When VBScript source code is contained in stand-alone files, they typically have the file extension .vbs.
When employed in Internet Explorer, VBScript is very similar in function to JavaScript ¨C- it processes code embedded in HTML. Both VBScript and JScript can be also used to create stand-alone HTA applications, which require IE to be run. However, many webmasters prefer to use JavaScript instead for better compatibility with alternative web browsers.
VBScript is also the language some notable e-mail worms, such as ILOVEYOU, were written in. There are several reasons for this: first, funny scroll-like icon of VBS files, so that users with little Windows experience may think it's a text file; second, possibility of writing a basic e-mail worm in VBS in just a few lines of code. Microsoft has since fixed the security holes that such worms exploited, so now they came to their demise.
Easy to Use and Learn:
If you already know Visual Basic or Visual Basic for Applications (VBA), VBScript will be very familiar. Even if you do not know Visual Basic, once you learn VBScript, you are on your way to programming with the whole family of Visual Basic languages. Although you can learn about VBScript in just these few Web pages, they do not teach you how to program. To learn programming, take a look at Step by Step books available from Microsoft Press.
Windows Script:
VBScript talks to host applications using Windows Script. With Windows Script, browsers and other host applications do not require special integration code for each scripting component. Windows Script enables a host to compile scripts, obtain and call entry points, and manage the namespace available to the developer. With Windows Script, language vendors can create standard language run times for scripting. Microsoft will provide run-time support for VBScript. Microsoft is working with various Internet groups to define the Windows Script standard so that scripting engines can be interchangeable. Windows Script is used in Microsoft Internet Explorer and in Microsoft Internet Information Service.
VBScript in Other Applications and Browsers:
As a developer, you can license VBScript source implementation at no charge for use in your products. Microsoft provides binary implementations of VBScript for the 32-bit Windows API, the 16-bit Windows API, and the Macintosh. VBScript is integrated with World Wide Web browsers. VBScript and Windows Script can also be used as a general scripting language in other applications.
VBScript Functions:
Date/Time functions
Math functions
String functions
Conversion functions
Array functions
Format functions
Other functions
Date/Time functions:
CDate
Date
DateAdd
DateDiff
DatePart
DateSerial
DateValue
Day
FormatDate
Hour
IsDate
Minute
Month
MonthName
Now
Second
Time
Timer
TimeSerial
TimeValue
Weekday
WeekdayName
Year
Math functions:
Abs
Atn
Cos
Exp
Hex
Int
Fix
Log
Oct
Rnd
Sgn
Sin
Sqr
Tan
String functions:
InStr
InStrRev
LCase
Left
Len
LTrim
RTrim
Trim
Mid
Replace
Right
Space
StrComp
String
StrReverse
UCase
Conversion functions:
Asc
CBool
CByte
CCur
CDate
CDbl
Chr
CInt
CLng
CSng
CStr
Hex
Oct
Array functions:
Array
Filter
IsArray
Join
LBound
Split
Bound
Format functions:
FormatCurrency
FormatDateTime
FormatNumber
FormatPercent
Other functions:
CreateObject
Eval Evaluates
GetLocale
GetObject
GetRef
InputBox
IsEmpty
IsNull
IsNumeric
IsObject
LoadPicture
MsgBox
RGB
Round
ScriptEngine
ScriptEngineBuildVersion
ScriptEngineMajorVersion
ScriptEngineMinorVersion
SetLocale Sets the locale
TypeName Returns
VarType
VBScript Constants:
Color Constants
Comparison Constants
Date and Time Constants
Date Format Constants
Miscellaneous Constants
MsgBox Constants
String Constants
Tristate Constants
VarType Constants
VBScript Errors:
VBScript Run-time Errors
VBScript Syntax Errors
VBScript Events:
Initialize Event
Terminate Event
VBScript Keywords:
Empty
False
Nothing
Null
True
VBScript Methods:
Clear Method
Execute Method
Raise Method
Replace Method
Test Method
Write Method
WriteLine Method
VBScript Objects and Collections:
Class Object
Debug Object
Err Object
Match Object
Matches Collection
Regular Expression (RegExp) Object
SubMatches Collection
VBScript Operators:
Operator Precedence
Operator Summary
Arithmetic Operators
Comparison Operators
Concatenation Operators
Logical Operators
VBScript Properties:
Description Property
FirstIndex Property
Global Property
HelpContext Property
HelpFile Property
IgnoreCase Property
Length Property
Number Property
Pattern Property
Source Property
Value Property
VBScript Statements:
Call Statement
Class Statement
Const Statement
Dim Statement
Do...Loop Statement
Erase Statement
Execute Statement
ExecuteGlobal Statement
Exit Statement
For Each...Next Statement
For...Next Statement
Function Statement
If...Then...Else Statement
On Error Statement
Option Explicit Statement
Private Statement
Property Get Statement
Property Let Statement
Property Set Statement
Public Statement
Randomize Statement
ReDim Statement
Rem Statement
Select Case Statement
Set Statement
Stop Statement
Sub Statement
While...Wend Statement
With Statement
The above information has been provided as a reference only. Directron.com is not responsible for any damage or problem caused as a result of correctly or incorrectly following the instructions outlined therein.
Related Articles: | HTML Tutorial/Guide/Help |
Last Updated: Sept. 8, 2005
(c) Directron.com, All rights reserved
If you find this article useful, please create a link to it from your website or tell a friend about it. If you have any comments or suggestions about this article, please email information@directron.us
|
|
Shipping Policy |
|
Customer Services |
|
Payment Policy |
|
|
Est. Shipping
Cost
Time-in-Transit Map
FAQ - Shipping
Top Reasons for
Delays
UPS,
FedEx,
Postal
Office
Walk-in Sales
APO/FPO Shipping
International
Tracking Orders |
Return Rates
Store Statistics
Customer Satisfaction
Account Applications
Frequent Errors
FAQ-Services
FAQ-Tech Support
Newsletter
Order Status |
Credit Card via Phone
Purchase Order
Prepay, PayPal
Resellers
Corporate
Schools,
Government
Terms & Conditions
Price & Tax
FAQ-Payment
|
|
Top Brands |
|
Abit,
Acer,
AMD, Antec,
AOpen,
Asus,
ATI,
Biostar,
Buffalo,
Cooler Master, Corsair, Creative, Dell, D-Link,
Enermax,
FSP,
Gigabyte,
Hauppauge,
HP,
Intel,
InWin,
Kingston,
Lenovo,
Lian-Li,
Linksys,
Lite-On,
Logisys,
Logitech,
Maxtor,
Microsoft,
MSI,
Mushkin,
Netgear,
OCZ,
Seagate,
Shuttle,
Sony,
SuperMicro,
ThermalTake,
Vantec,
ViewSonic,
Western Digital,
XFX,
Zalman.
|
Have a question about our products, services or technical issues? Find the answer instantly! Type your question or key words in English:
95% email/ phone questions already have answers on our web site.
|
Copyright (c) 1997-2009 Directron.com, Inc., Houston, Texas
Buy -
Sell -
Trade -
Build -
Repair -
Upgrade -
Help -
Troubleshoot -
Shopping
Computers -
Laptops -
Servers -
Hardware -
Parts -
Software -
Peripherals -
Services
High Quality -
Low Prices -
Discount Shop -
Large Selection -
Free Products -
Fast Shipping
Affiliates: Dallas Computer Store - San Antonio Computer Store - K12 Education Computer Systems |
|  |