ASP Cheat Sheet v1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Functions

Methods

ASP / VBScript

Request
BinaryRead
Response
AddHeader
AppendToLog
BinaryWrite
Clear
End
Flush
Redirect
Write
Application
Lock
Unlock
Session
Abandon
Server
CreateObject
Execute
GetLastError
HTMLEncode
MapPath
Transfer
URLEncode

Properties
Response
Buffer
CacheControl
Charset
ContentType
Expires
ExpiresAbsolute
IsClientConnected
Pics
Status
Request
TotalBytes

REGULAR EXPRESSIONS - PATTERNS

FUNCTION ARGUMENT ORDERS

Start of string

DateAdd(Interval, Number, Date)

End of string

DateDiff(Interval, Date1, Date2)

Any single character

InStr(Start, String, Substring, Compare)

(a|b)
a or b
REGULAR
EXPRESSIONS
(...)
Group section- MODIFIERS
[abc]
Item in range (a or b or c)
/g
Global matching
[^abc]
Not in range (not a or b or c)
/i
Case insensitive
[a-z]
Any lower-case letter
/s
Single line mode
[A-Z]
Any upper-case letter
/m
Multi line mode
[0-9]
Any numeric digit
a?
Zero or one of a

FormatDateTime (Date, DateFormat)


Join(Array, Delimiter)
Left(String, Length)
Replace(Haystack, Needle, Replacement)
Split(Expression, Delimiter)
FILE MODES

a*

Zero or more of a

Reading

a+

One or more of a

Writing

a{3}

Exactly 3 of a

Appending

a{3,}

3 or more of a

a{3,6}

Between 3 and 6 of a
!(pattern) "Not" prefix. Apply rule when

COMMON LCID CODES

URL does not match pattern.

2057

English (UK)

\b

End of word

1033

English (US)

\n

New line

1036

French (France)

\r

Carriage return

1031

German (Germany)

Escape Character

1034

Spanish (Spain)

\t

Tab

\s

White space

\w

Any word (= [A-Za-z0-9_])

STRING CONSTANTS

Date
Date
DateAdd
DatePart
DateSerial
Day
FormatDateTime
Hour
Minute
Month
MonthName
Now
Second
Weekday
WeekdayName
Year
Arrays
Join
Redim
Split
Ubound

COMPARISON CONSTANTS

Mathematical
Abs
Atn
Cos
Exp
Log
Rnd (Randomize)
Round
Sin
Sqr
Sgn
Tan

Hour

VBBinaryCompare

Collections

Minute

VBTextCompare

Second

VBDataBaseCompare

DATE FUNCTION ARGUMENTS

VbCr

Carriage Return

VbCrLf

VbCr and Line Feed

VbFormFeed

Form Feed

yyyy

Year

VbLf

Line Feed

Quarter

VbNullChar

Null Character

Month

VbNullString

Null String

Day of Year

VbTab

Tab Character

Day

Weekday

ww

Week of Year

Server
ScriptTimeout

Error
ASPCode
ASPDescription
Category
Column
Description
File
Line
Number
Source

Session
CodePage
LCID
SessionID
Timeout

String
FormatCurrency
InStr
LCase
Left
Len
Mid
Replace
Response.write
Right
String
StrReverse
Trim
UCase

REDIRECT WITH 301 HEADER

NAMED DATE CONSTANTS

Response.Status="301 Moved

vbGeneralDate

vbLongDate

Response.AddHeader "Location",

vbShortDate

"http://www.website.com"
Response.End

vbLongTime

vbShortTime

Permanently"

INCLUDING A FILE

<!--#include file="include.inc"-->

Available free from


AddedBytes.com

Response
Cookies
Request
ClientCertificate
Cookies
Form
QueryString
ServerVariables
Application
Contents
StaticObjects
Session
Contents
StaticObjects

You might also like