Mega Code Archive

 
Categories / ASP.Net Tutorial / Sessions
 

Session IsReadOnly

<%@ Page Language="vb" EnableSessionState="ReadOnly" %> <html>    <head>       <script runat="server">          Sub Page_Load()             If Session.IsReadOnly Then                Message.Text = "The current Session (SessionID: " & _                   Session.SessionID & ") is read-only for this page."             Else                Session("foo") = "foo"                Message.Text = "The current Session (SessionID: " & _                   Session.SessionID & ") can be written to from this page."             End If          End Sub       </script>    </head> <body>    <asp:label id="Message" runat="server"/> </body> </html>