Mega Code Archive

 
Categories / ASP.Net Tutorial / Sessions
 

Save value to session object and read them back (VB net)

<%@Page Language="VB" %> <script runat="server">    sub Page_Load(Sender as Object,e as EventArgs)       dim strVariable as string       Session("Name")="A "       Session("FavoriteColor")="Blue "       Session("EyeColor")="Brown "       Session("AMessage")="Welcome to my world "       Session("ASPNET")="asp.net "       for each strVariable in Session.Contents          Label1.Text +="<b>" & strVariable &"</b>:" & _          Session(strVariable)&"<br>"       next    end sub </script> <html><body>    <form runat="server">       <asp:Label id="Label1" runat="server"/>    </form> </body></html>