J
Joe Abou Jaoude
hi,
I just want simply to preserve some data in my usercontrol on postbacks.
so I added this property in my UserControl
Protected Property MyProperty() As String
Get
If Not ViewState("xxx") Is Nothing Then
Return ViewState("xxx")
Else
Return ""
End If
End Get
Set(ByVal value As String)
ViewState("xxx") = value
End Set
End Property
However I lost the viewstate value on postbacks. I checked that my
usercontrol has enabledviewstate=true.
What I m doing wrong ?
If I replace in the code ViewState by Session , the data is preserved,
however session won't work for me.(case of two pages using the
usercontrol in the same session)
Thank you
I just want simply to preserve some data in my usercontrol on postbacks.
so I added this property in my UserControl
Protected Property MyProperty() As String
Get
If Not ViewState("xxx") Is Nothing Then
Return ViewState("xxx")
Else
Return ""
End If
End Get
Set(ByVal value As String)
ViewState("xxx") = value
End Set
End Property
However I lost the viewstate value on postbacks. I checked that my
usercontrol has enabledviewstate=true.
What I m doing wrong ?
If I replace in the code ViewState by Session , the data is preserved,
however session won't work for me.(case of two pages using the
usercontrol in the same session)
Thank you