G
Guest
Hi,
Is there any way so that I can create a copy of session object...
Dim _mclass As New _MyClass
_mclass.GetSetVar1 = "Value1"
_mclass.GetSetVar2 = "Value2"
Session("A") = _mclass
Dim _gclass As New _MyClass
_gclass = CType(Session("A"), _MyClass)
_gclass.GetSetVar1 = "Value3"
Session("B") = _gclass
Response.Write(CType(Session("A"), _MyClass).GetSetVar1)
Response.Write(CType(Session("A"), _MyClass).GetSetVar2)
Response.Write(CType(Session("B"), _MyClass).GetSetVar1)
Response.Write(CType(Session("B"), _MyClass).GetSetVar2)
If you print the above session values, you will get
value2value3value2value3
Is there any way so that I can create a copy of session object...
Dim _mclass As New _MyClass
_mclass.GetSetVar1 = "Value1"
_mclass.GetSetVar2 = "Value2"
Session("A") = _mclass
Dim _gclass As New _MyClass
_gclass = CType(Session("A"), _MyClass)
_gclass.GetSetVar1 = "Value3"
Session("B") = _gclass
Response.Write(CType(Session("A"), _MyClass).GetSetVar1)
Response.Write(CType(Session("A"), _MyClass).GetSetVar2)
Response.Write(CType(Session("B"), _MyClass).GetSetVar1)
Response.Write(CType(Session("B"), _MyClass).GetSetVar2)
If you print the above session values, you will get
value2value3value2value3