N
Namshub
I'm A client server developer by trade and i'm moving my skill set slowly
over to ASP.NET.
One question, I have a class, that i populate on a postback... I want to
keep this data persistant though other multiple postbacks.
What is the desired mechanism to use this.
I'm using the following code but not sure if this is the appropriate
solution to the problem
Private PatientDetails As Patient
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If ViewState("Patient") Is Nothing Then
PatientDetails = New Patient
viewstate.Add("Patient", PatientDetails)
Else
PatientDetails = New Patient
PatientDetails = viewstate("Patient")
End If
Private Function SearchPAS() As Boolean ' called by a button clik
PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
'which fills all the property fields
viewstate("Patient") = PatientDetails
end function
over to ASP.NET.
One question, I have a class, that i populate on a postback... I want to
keep this data persistant though other multiple postbacks.
What is the desired mechanism to use this.
I'm using the following code but not sure if this is the appropriate
solution to the problem
Private PatientDetails As Patient
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If ViewState("Patient") Is Nothing Then
PatientDetails = New Patient
viewstate.Add("Patient", PatientDetails)
Else
PatientDetails = New Patient
PatientDetails = viewstate("Patient")
End If
Private Function SearchPAS() As Boolean ' called by a button clik
PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
'which fills all the property fields
viewstate("Patient") = PatientDetails
end function