IT SOLUTIONS
Your TECHNOLOGY partner! 
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

Advanced
-Collapse +Expand ASP Classic Store

Prestwood eMagazine

June Edition
Subscribe now! It's Free!
Enter your email:

   ► KB ►► Website Scri...ASP Classic   All Groups  

ASP Classic Coding Most Read KB Posts

Page Contents


Most Read KB Articles Since 3/28/2008

ASP Classic Coding Group

  KB Article    

Mike Prestwood
1. Send email with ASPMail

How to use ASPMail to send email from your web site.

Posted to KB Topic: Language Basics
10 years ago, and updated 7 years ago

KB Post
Nothing New Since Your Last Visit
45745
Hits

Mike Prestwood
2. Response.Flush and Response.Buffer

Response.Flush sends the contents of the buffer to the browser. This command is useful for showing a visitor something while slow loading pages load.

Posted to KB Topic: Language Details
7 years ago, and updated 38 months ago

KB Post
Nothing New Since Your Last Visit
15828
Hits

Mike Prestwood
3. ASP Classic Comments (' or REM)

Commenting Code
ASP Classic, like all the VB-based languages, uses a single quote (') or the original class-style basic "REM" (most developers just use a quote). ASP Classic does NOT have a multiple line comment.

Preprocessor Directives - @ and #
An @ is used for preprocessor directives within ASP code (within <% %>) and a # is used for HTML-style preprocessor directives.

Note: ASP Classic does not support VB Classic's #If directive.

Posted to KB Topic: Tool Basics
55 months ago, and updated 53 months ago
(2 Comments , last by Anonymous )

Code
Nothing New Since Your Last Visit
13315
Hits

Mike Prestwood
4. ASP Classic If Statement (If..ElseIf..Else..End If)

The End If is optional if you put your code on a single line.

Posted to KB Topic: Language Basics
54 months ago, and updated 51 months ago

Code

KB Post
Nothing New Since Your Last Visit
12611
Hits

Mike Prestwood
5. Clear Application and Session Variables Using ASP classic

Use Application.Contents.RemoveAll and Session.Contents.RemoveAll

Posted to KB Topic: Language Basics
6 years ago, and updated 37 months ago

KB Post
Nothing New Since Your Last Visit
12460
Hits

Mike Prestwood
6. ASP Classic Associative Array (Scripting.Dictionary)

Use the scriptiing dictionary object which is available on later versions of ASP Classic (all still commonly in use). Both Access VBA and VB Classic use a collection for this but collections are not supported in ASP Classic.

Dim StateList
Set StateList = Server.CreateObject("Scripting.Dictionary")
StateList.Add "CA", "California"
StateList.Add "NV", "Nevada"
Response.Write "I live in " & StateList.Item("CA")
Posted to KB Topic: Language Details
54 months ago, and updated 53 months ago

Code

KB Post
Nothing New Since Your Last Visit
10764
Hits

Mike Prestwood
7. ASP Classic Empty String Check (Len(s&vbNullString))

In ASP Classic, you have to add an empty string to the value being compared in order to get consistent results. For example, add &"" to your string varilable or it's code equivalent &vbNullString. Then compare to an empty string or verify it's length to 0 with Len.

Posted to KB Topic: ASP Classic
45 months ago, and updated 33 months ago
(3 Comments , last by Anonymous )

Code

Article
Nothing New Since Your Last Visit  
10033
Hits

Mike Prestwood
8. Using On Error Resume Next You can use "On Error Resume Next" to suppress errors and "On Error Goto 0" to stop suppressing errors.
Posted to KB Topic: Language Basics
7 years ago, and updated 59 months ago
(2 Comments , last by mprestwood )

KB Post
Nothing New Since Your Last Visit
10001
Hits

Mike Prestwood
9. Associative Arrays in ASP Classic

What is the syntax in ASP Classic for using an associative array?

Posted to KB Topic: Language Details
5 years ago, and updated 31 months ago
(1 Comments )

FAQ
Nothing New Since Your Last Visit
9762
Hits

Mike Prestwood
10. ASP Classic Constructors (Class_Initialize)

When an object instance is created from a class, ASP calls a special parameter-less sub named Class_Initialize. Since you cannot specify parameters for this sub, you also cannot overload it.

When a class is destroyed, ASP calls a special sub called Class_Terminate.

Posted to KB Topic: OOP
53 months ago, and updated 53 months ago

Code

KB Post
Nothing New Since Your Last Visit  
8952
Hits



Most Read by Members

ASP Classic Coding Group

  KB Article    

Mike Prestwood
1. Send email with ASPMail

How to use ASPMail to send email from your web site.

Posted to KB Topic: Language Basics
10 years ago, and updated 7 years ago

KB Post
Nothing New Since Your Last Visit
45745
Hits

Mike Prestwood
2. CDO (Collaboration Data Objects) Using CDO to send email.
Posted to KB Topic: ASP Classic
10 years ago

KB Post
Nothing New Since Your Last Visit
2059
Hits

Mike Prestwood
3. ASP Classic Array (x = Array())

Arrays in ASP Classic use a 0-based indice.

Use UBound to get the number of elements. UBound returns -1 if the array has no elements, 0 if it has 1, 1 if it has 2, etc.

Posted to KB Topic: ASP Classic
39 months ago, and updated 27 months ago

Code

KB Post
Nothing New Since Your Last Visit  
4811
Hits

Mike Prestwood
4. Associative Arrays in ASP Classic

What is the syntax in ASP Classic for using an associative array?

Posted to KB Topic: Language Details
5 years ago, and updated 31 months ago
(1 Comments )

FAQ
Nothing New Since Your Last Visit
9762
Hits

Mike Prestwood
5. ASP redirect http to https

To redirect from http to https, check the Request.ServerVariables HTTPS field and then use Response.Redirect if set to "off".

Posted to KB Topic: Language Basics
9 years ago, and updated 44 months ago

Code
Nothing New Since Your Last Visit
2873
Hits

Mike Prestwood
6. ASP Classic Yes/No Function

The following function demonstrates one technique for coding a Yes/No dropdown. It uses a for loop which can be expanded to handle more than the 3 states (Y, N, and blank).

Example of calling the function:

Do you fish? <%=YesNoDropDown("ynFish", "")%>
Posted to KB Topic: ASP Classic
36 months ago

Code
Nothing New Since Your Last Visit
2312
Hits

Mike Prestwood
7. ASP Classic Sort Records (Sort)

In ASP, using ADO, you sort a set of records using the Sort property.

Posted to KB Topic: ASP Classic
40 months ago

Code
Nothing New Since Your Last Visit
2390
Hits

Mike Prestwood
8. ASP Classic If Statement (If..ElseIf..Else..End If)

The End If is optional if you put your code on a single line.

Posted to KB Topic: Language Basics
54 months ago, and updated 51 months ago

Code

KB Post
Nothing New Since Your Last Visit
12611
Hits

Mike Prestwood
9. ASP Classic Exception Trapping (On Error)

Languages Focus: Exception Trapping

A common usage of exception handling is to obtain and use resources in a "try-it" block, deal with any exceptions in an "exceptions" block, and release the resources in some kind of "final" block which executes whether or not any exceptions are trapped.

ASP Classic Exception Trapping

Posted to KB Topic: ASP Classic
56 months ago, and updated 55 months ago

Code
Nothing New Since Your Last Visit
3067
Hits

Mike Prestwood
10. Response.Write Assignment Operator This is a simple example of passing a value to a JavaScript function. You can pass values to JavaScript the same way you pass values to HTML.
Posted to KB Topic: Tool Basics
5 years ago

Code
Nothing New Since Your Last Visit
2448
Hits
Icon Legend:
Since your last logged visit:
- New to you or updated since your last visit (sign in now to activate).
- NOT new to you since your last visit (sign in now to activate).
-
  Load Time=1 seconds.
 
Print This
-
 
Have a question? Need our services? Contact us now.
--Mike Prestwood

Call: 916-726-5675

email: info@prestwood.com


-
 
Connect With Us...
PrestwoodBoards
Join Us!
Facebook
Like our page!
Twitter
Follow us!
LinkedIn
Join Group
YouTube
View channel.
Go ahead!   Use Us! Call: 916-726-5675 


©1995-2013 Prestwood IT Solutions.   [Security & Privacy]   Made in the U.S.A..   No H1-B.   No offshoring.