home screen

Search



Number Of Result : 0

Result :


Monday, November 16, 2009

Syntax Of ASP

If Condition

If Request("FName") = "" Then
Response.Clear
Response.Redirect "test.html"
Else
Response.Write Request("FName")
End If


For each

dim x,y
for each x in Request.Cookies
response.write("")
if Request.Cookies(x).HasKeys then
for each y in Request.Cookies(x)
response.write(x & ":" & y & "=" & Request.Cookies(x)(y))
response.write("")
next
else
Response.Write(x & "=" & Request.Cookies(x) & "")
end if
response.write ""
next


- Session

Session.Timeout=5

- Use the Abandon method to end a session immediately:
Session.Abandon


- Remove Session
Session.Contents.Remove("sale")

- Remove All Session
Session.Contents.RemoveAll()





- Include Files

--Syntax FILE Keyword
Use the file keyword to indicate a relative path. A relative path begins with the directory that contains the including file.

If you have a file in the html directory, and the file "header.inc" resides in html\headers, the following line would insert "header.inc" in your file:
<!--#include file="Header.inc"-->

--The Virtual Keyword

Use the virtual keyword to indicate a path beginning with a virtual directory.

If a file named "header.inc" resides in a virtual directory named /html, the following line would insert the contents of "header.inc":
<!--#include virtual="Header.inc"-->



-Do While...Loop

mynumber=0
Do While mynumber<10
response.write("Hello")
mynumber=mynumber+1

Loop


-Do Until....Loop

mynumber=0
Do Until mynumber=10
response.write("Hello")
mynumber=mynumber+1

Loop


-Select Case....End Select

mynumber=3
Select Case mynumber
Case 1
Response.write ("Number 1")
Case 2
Response.write ("Number 2")
Case Else
Response write ("Mynumber is higher than 5")
End Select









No comments: