会话保存的数据未在vb.net中获取

时间:2016-05-25 11:01:00

标签: asp.net vb.net session

如果以前保存在会话中,我试图在文本框中获取数据。当用户输入页面时,它将为空白。如果他填写数据&提交,然后我想要如果页面再次加载,那么它应该从会话值

Private Sub Online_Medicines_order_online_Default_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Session("patientName") Is Nothing Then
            patientName.Text = ""
        Else
            patientName.Text = Session("patientName").ToString
        End If

    End Sub

Private Sub orderButton_Click(sender As Object, e As EventArgs) Handles orderButton.Click
    Session("patientName") = patientName.Text
    Session("address1") = address1.Text
    Session("address2") = address2.Text
    Session("landmark") = landmark.Text
    Session("zip") = zip.Text
    Session("mobileNumber") = mobileNumber.Text
    Session("city") = city.Text
End Sub

0 个答案:

没有答案