M
macduder83
All,
I 2 classes, parent and child class. I instantiate the child class by
doing the following:
I have a property that looks like this
Private Property propChild() As ChildClass
Get
Return CType(Session(ChildClass.NAMES.C_NAME), ChildClass)
End Get
Set(ByVal Value As ChildClass)
Session(ChildClass.NAMES.C_NAME) = Value
End Set
End Property
I then set the property by doing this
Me.propChild = new ChildClass()
When I call the constructor( new ) for the ChildClass it fires off the
New for the parent class. This is fine and desired behavior. Problem is
that ASP.NET seems to add the child class to the session and all of its
members(strings,ints and so on) the problem is that it loses all the
parent information. The parent has a few properties I need but they are
lost after a postback. I have tried useing Application and Session. I
do not want to go to viewstate as that may be the wrong place to store
complex data types. If anyone has a solution that would be greatly
appreciated.
Thanks !
I 2 classes, parent and child class. I instantiate the child class by
doing the following:
I have a property that looks like this
Private Property propChild() As ChildClass
Get
Return CType(Session(ChildClass.NAMES.C_NAME), ChildClass)
End Get
Set(ByVal Value As ChildClass)
Session(ChildClass.NAMES.C_NAME) = Value
End Set
End Property
I then set the property by doing this
Me.propChild = new ChildClass()
When I call the constructor( new ) for the ChildClass it fires off the
New for the parent class. This is fine and desired behavior. Problem is
that ASP.NET seems to add the child class to the session and all of its
members(strings,ints and so on) the problem is that it loses all the
parent information. The parent has a few properties I need but they are
lost after a postback. I have tried useing Application and Session. I
do not want to go to viewstate as that may be the wrong place to store
complex data types. If anyone has a solution that would be greatly
appreciated.
Thanks !