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 ! 4 953
Hi macduder:
Do you have some more code to show how you pull the object out of
session?
--s
On 13 Apr 2005 20:33:10 -0700, "macduder83"
<ad**************@gmail.com> wrote: 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 !
--
Scott http://www.OdeToCode.com/blogs/scott/
Hi macduder:
Do you have some more code to show how you pull the object out of
session?
--s
On 13 Apr 2005 20:33:10 -0700, "macduder83"
<ad**************@gmail.com> wrote: 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 !
--
Scott http://www.OdeToCode.com/blogs/scott/
I have figured it out. I was calling a Load method incorrectly, which
was nuking a few of the properties.
I have figured it out. I was calling a Load method incorrectly, which
was nuking a few of the properties. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Matthew Louden |
last post by:
I want to know why C# doesnt support multiple inheritance? But why we can
inherit multiple interfaces instead? I know this is the rule, but I dont
understand why. Can anyone give me some concrete...
|
by: Tom Anderson |
last post by:
I am currently having an issue with an ASP.Net 1.1 Web page that does the
following remotely but not locally.
Click on a control
Check for postback, if postback, handle the event, otherwise...
|
by: Shawnk |
last post by:
Some Sr. colleges and I have had an on going discussion relative to when and
if
C# will ever support 'true' multiple inheritance.
Relevant to this, I wanted to query the C# community (the...
|
by: Tim_Mac |
last post by:
hi,
using .net 2.0, i have a web form with lots of textboxes, drop-down-lists
etc. There are lots of required field validators and regular expression
validators. When i click the 'save' button,...
|
by: Jason |
last post by:
I have a webpage that I've wrapped in an Atlas UpdatePanel. This page
contains four textboxes, each with AutoPostBack set to true. The problem
comes when someone edits the first box and tabs to...
|
by: mc |
last post by:
I'm writing an app for managing Task Lists, I'm trying to add some
controls to a form that I can use to link tasks, my original intention
was to: -
Add two list boxes, one listing "all Tasks"...
|
by: =?Utf-8?B?TWlrZSBMb2dhbg==?= |
last post by:
My environment. .Net 2.0 VS2k5 SP1, IE6 (6.0.2900.2180)
I have a web content page. The page will post back twice if I am running in
debug mode. However if I run through the breakpoints fast...
|
by: Peter |
last post by:
ASP.NET
I have an application which use ASP.NET Autocomplete extender which works
great. But I have a question how to update all the fields on the screen
using Ajax.
Users starts typing in a...
|
by: Oriane |
last post by:
Hello there,
I use an Ajax slider extender and I'm try to find a workaround to a known
(http://forums.asp.net/p/1092702/2681110.aspx) "bug" of the slider control
from the Ajax Control Toolkit....
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |