' Using_External_Utility_Class_for_Passing_Variables_Between_Web_pages_Using_Session.aspx.vb.txt Public Class WebForm1 Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click Dim cb As New clsStateUtility.Before cb.var1 = txtInput.Text Session("Before") = cb End Sub Private Sub btnRecall_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRecall.Click Dim cb As New clsStateUtility.Before If Session("Before") Is Nothing Then lblOutput.Text = "not found" Else cb = CType(Session("Before"), clsStateUtility.Before) lblOutput.Text = cb.var1 End If End Sub End Class Public Class clsStateUtility Public Structure After Public var1 As String Public var2 As String Private x As Integer End Structure Public Structure Before Public var1 As String Public var2 As String Private x As Integer End Structure End Class