Firstly, if this is the wrong newsgroup for my question, please direct me
elswhere and accept my apologies! It's a question about ASP.NET but also
uses VB.NET classes.
This is a little strange, but I feel I'm missing an obvious answer. Perhaps
you guru's can enlighten me?
I have webform. I also have a class, which includes the following
declaration and property:
____________
Protected _IRWKeyMileston es as IRWKeyMilestone s
Public Property IRWKeyMilestone s() As IRWKeyMilestone s
Get
If _IRWKeyMileston es Is Nothing Then
_IRWKeyMileston es = New IRWKeyMilestone s(Cascade, Me)
End If
Return _IRWKeyMileston es
End Get
Set(ByVal Value As IRWKeyMilestone s)
_IRWKeyMileston es = Value
End Set
End Property
____________
The IRWKeyMilestone s class is marked "<Serialisable( )>" and inherits the
..net "Collection " class.
The IRWKeyMilestone s collection is populated via the web form, that's not
important right now. When I refer to "IRWKeyMileston es" elsewhere in the
code, it gets it nicely from the above property as expected. And when I
change an IRWKeyMilestone s item, it updates the collection nicely. So far,
so good.
I have a "Save" button on my web form, which calls a "Save" method, which
saves the collection to the database. Again, the details of that aren't
imporant right now. The point is, it works fine and the _IRWKeyMileston es
collection is persisted upon postback of the form.
Now, the problem:
I have another button, totally unrelated, elsewhere on my webform. This
button also causes a postback - to update other parts of the page. BUT
when this particular postback happens, it seems to obliterate
_IRWKeyMileston es; it sets it to Nothing. So all changes to the collection
are lost. I remind you, IRWKeyMilestone s is *totally unrelated* to the
button being pressed.
Can anyone think of an obvious reason why _IRWKeyMileston es isn't being
persisted in the second instance? I thought putting "Protected" in front
of it was enough? Obviously not.
Help !
Thanks,
Owen
PS. replies cc'd via email appreciated
ow************@ mantix.com