<%@ Import Namespace="System.Data"%>
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim myArr(3) As String
myArr(0) = "Weerachai Nukitram"
myArr(1) = "Surachai Sirisart"
myArr(2) = "Adisorn Bunsong"
myArr(3) = "Surapong Chunsiripun"
Session("mySession") = myArr
Me.lblText.Text = "Array & Session Created <a href=AspNetArraySession2.aspx>click here</a> to view"
End Sub
</script>
<html>
<head>
<title>ThaiCreate.Com ASP.NET - Array</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label id="lblText" runat="server"></asp:Label>
</form>
</body>
</html>
AspNetArraySession2.aspx
<%@ Import Namespace="System.Data"%>
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim myArr As Array
myArr = Ctype(Session("mySession"),Array)
Dim i As Integer
For i = 0 To UBound(myArr)
Me.lblText.Text = Me.lblText.Text & "(" & i & ")" & myArr(i) & "<br>"
Next
End Sub
</script>
<html>
<head>
<title>ThaiCreate.Com ASP.NET - Array</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label id="lblText" runat="server"></asp:Label>
</form>
</body>
</html>