Look for Variables : Session Variables « Sessions « ASP.NET Tutorial






<% @ Page Language="VB" %>

<html>
<head>
   <title>Look for Variables</title>
</head>
<body>
  <center><h1>Look for Session and Application Variables</h1></center><hr/>
  <%
    Dim Book, Chapter, Publisher, Author As String

    Book = Session("Book")
    Chapter = Session("Chapter")
    Publisher = Application("Publisher")
    Author = Application("Author")
    
    If (Book = Nothing) Then
      Response.Write("Book: Unknown <br/>")
    Else
      Response.Write("Book: " & Book & "<br/>")
    End If

    If (Chapter = Nothing) Then
      Response.Write("Chapter: Unknown <br/>")
    Else
      Response.Write("Chapter: " & Chapter & "<br/>")
    End If

    If (Publisher = Nothing) Then
      Response.Write("Publisher: Unknown <br/>")
    Else
      Response.Write("Publisher: " & Publisher & "<br/>")
    End If

    If (Author = Nothing) Then
      Response.Write("Author: Unknown <br/>")
    Else
      Response.Write("Author: " & Author & "<br/>")
    End If
  %>

</body>
</html>








11.3.Session Variables
11.3.1.Using Session State
11.3.2.Retrieve the value of an item that you have stored in Session state.
11.3.3.Sorting a DataView stored in Session state.
11.3.4.Save value in text box to session and read it back (VB.net/C#)
11.3.5.Save value to session object and read them back (VB.net)
11.3.6.Store user defined object in Session (C#)
11.3.7.Setting and retrieving objects from the Session using State Service and a base page (C#)
11.3.8.Setting and retrieving objects from the Session using State Service and a base page (VB)
11.3.9.A session-aware base page
11.3.10.Session counter and application counter (C#)
11.3.11.Session counter and application counter (VB)
11.3.12.Look for Variables