web 2.0

ASP.NET(vb.net) Session.Item() - Session Object

ASP.NET(vb.net) Session.Item() - Session Object - Session.Item() : Session Item are Item that are generated to be used in a single communication session.

ShotDev Focus:
- ASP.NET(vb.net) Session.Item() - Session Object

Example

AspNetSessionItem.aspx

<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
'*** Create Session ***'
Session.TimeOut = 20
Session("Name") = "Mr.Weerachai Nukitram"
Session("NickName") = "Mr.Win"
Session.Add("SiteName","www.ShotDev.Com")

'*** Read Session ***'
Me.lblText1.Text = Session.Item("Name")
Me.lblText2.Text = Session.Item("NickName")
Me.lblText3.Text = Session.Item("SiteName")
End Sub

</script>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form runat="server">
<asp:Label id="lblText1" runat="server"></asp:Label><br />
<asp:Label id="lblText2" runat="server"></asp:Label><br />
<asp:Label id="lblText3" runat="server"></asp:Label><br />
</form>
</body>
</html>

Screenshot

ASP.NET(vb.net) Session.Item() - Session Object
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.