How can I access the values stored in a session object with a class in asp.net?
3 Answers
Protected Sub EnterInfoButton_OnClick(ByVal sender As Object, ByVal args As EventArgs)
Session("FirstName") = Server.HtmlEncode(FirstNameTextBox.Text)
Session("LastName") = Server.HtmlEncode(LastNameTextBox.Text)
Session("Address") = Server.HtmlEncode(AddressTextBox.Text)
Session("City") = Server.HtmlEncode(CityTextBox.Text)
Session("StateOrProvince") = Server.HtmlEncode(StateOrProvinceTextBox.Text)
Session("ZipCode") = Server.HtmlEncode(ZipCodeTextBox.Text)
Session("Country") = Server.HtmlEncode(CountryTextBox.Text)
EnterUserInfoPanel.Visible = False
UserInfoPanel.Visible = True
SetLabels()
End Sub
1 Comment
jmoreno
@James Johnson, Within a class that inherits from System.Web.UI.Page it will.