ASP Session & Array ตัวอย่างการใช้ Session เข้ามาจัดการค่าของ Array
Syntax
<%
Dim Array()
Session("Name") = Array
%>
ASPSessionArray.asp
<% Option Explicit %>
<html>
<head>
<title>ThaiCreate.Com ASP Session & Array</title>
</head>
<body>
<%
Dim myArr(4),mySession
myArr(0) = "I Love ThaiCreate.Com 0"
myArr(1) = "I Love ThaiCreate.Com 1"
myArr(2) = "I Love ThaiCreate.Com 2"
myArr(3) = "I Love ThaiCreate.Com 3"
myArr(4) = "I Love ThaiCreate.Com 4"
Session("mySession") = myArr
'*** Used Session Array ***'
Dim i
For i = 0 To UBound(Session("mySession"))
Response.write Session("mySession")(i) & "<br>"
Next
'*************************'
%>
</body>
</html>