web 2.0

ASP.NET(vb.net) & ArrayList and Session

ASP.NET(vb.net) & ArrayList and Session - ArrayList and Session() : This learn and example script how to use ArrayList and Session.

ShotDev Focus:
- ASP.NET(vb.net) & ArrayList and Session

Example

AspNetArrayListSession1.aspx

<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim objArrList As ArrayList
Dim i As Integer

objArrList = New ArrayList

objArrList.Add("white")
objArrList.Add("black")
objArrList.Add("red")
objArrList.Add("yellow")
objArrList.Add("green")

Session("mySession") = objArrList

Me.lblText.Text = "ArrayList Created <a href=AspNetArrayListSession2.aspx>Click here</a> to view"
End Sub
</script>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label id="lblText" runat="server"></asp:Label>
</form>
</body>
</html>

AspNetArrayListSession2.aspx

<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim objArrList As ArrayList
Dim i As Integer

objArrList = Ctype(Session("mySession"),ArrayList)

For i = 0 To objArrList.Count - 1
Me.lblText.Text = Me.lblText.Text &  objArrList(i) & "<br>"
Next
End Sub
</script>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label id="lblText" runat="server"></asp:Label>
</form>
</body>
</html>

Screenshot

 ASP.NET(vb.net) & ArrayList and Session

 ASP.NET(vb.net) & ArrayList and Session
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.