Prestwood eMag
Our monthly opt-in coupons+newsletter.
|
 portal.prestwood.com
|
|
July 2010 - ASP Classic Edition
|
Year 12 Issue 7
|
|
|
|
Your full service technology partner!
|
|
From The Editor
 Mike Prestwood
|
Lots of new features for PrestwoodBoards.com, here are just a few...
- Enhanced privacy settings!
- Anonymous posts.
- Secure SSL signin.
- PrestwoodBoards and Prestwood.com now separate.
- Upload your business card.
- Upload your company or group logo.
- Set your account for personal or business.
- Advertise your company through your PrestwoodBoards home page.
- Setup quality back-links to your website.
- New Online Today page.
Visit PrestwoodBoards.com Now!
Expert guidance from working professionals!
psSendMail DLL topic:
v1.1 Documentation by Wes Peterson
v1.1 of psSendMail will soon be replaced by v2.
Language Basics topic (classic post):
Send email with ASPMail by Mike Prestwood
How to use ASPMail to send email from your web site.
|
Monthly ASP Classic Lesson
|
|
ASP Classic Topic:
Code Snippet of the Month
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", "")%>
Function YesNoDropDown(strName, strSelected)
Dim i
Dim strSelectedString
Dim YesNoName
Dim YesNoCode
YesNoName = Array("Yes","No")
YesNoCode = Array("Y","N")
YesNoDropDown = "<select name='" & strName & "'>" & vbcrlf
YesNoDropDown = YesNoDropDown & "<option>" & "--" & "</option>"
For i = 0 To UBound(YesNoName)
If strSelected = YesNoCode(i) Then
strSelectedString = "Selected"
Else
strSelectedString = ""
End If
YesNoDropDown = YesNoDropDown & "<option value='" & YesNoCode(i) & "' " & _
strSelectedString & " >" & YesNoName(i) & "</option>" & vbcrlf
Next
YesNoDropDown = YesNoDropDown & "</select>" & vbcrlf
End Function
ASP Classic Topic:
Error: error 'ASP 0208 : 80004005'
Cannot use generic Request collection
/_private/footer_content.inc, line 72
Cannot use the generic Request collection after calling BinaryRead.
Explanation: Although you can use the generic request collection, as in Request("SomeValue"), for either Request.Form("SomeValue") or Request.QueryString("SomeValue"), it's best to avoid the generic request collection until it's really needed. The generic request collection causes problems in some circumstances. For example, you cannot call the generic request collection after a BinaryRead.
ASP Classic Topic:
Resource Link of the Month: VBScript Language Reference on Microsoft.com
The best resource for quickly looking up ASP Classic commands. Even better than having a reference book.
Language Details Topic:
Question: What is the syntax in ASP Classic for using an associative array?
Answer: Use a dictionary:
Dim StateList
set StateList = Server.CreateObject("Scripting.Dictionary")
StateList.Add "CA", "California"
Response.Write "NV is " & StateList("NV") For more examples, refer to our ASP Classic Associative Array (Scripting.Dictionary) article.
Language Details Topic:
Tip of the Month
Although you can use the generic request collection, as in Request("SomeValue"), for either Request.Form("SomeValue") or Request.QueryString("SomeValue"), it's best to avoid the generic request collection until it's really needed. Use a For Each loop to loop through elements.
|
|
|