First of all - Merry Xmas!
My Problem is that I've got one TreeModel and several TreeViews attached to
it. In the meanwhile I "solved" the problem storing my Model in the
Session-Collection so it does not have to be serialized on postback. But
still it would be interesting how to implement the MVC-Pattern correctly in
ASP.NET. But I guess I'd better put that in a new Post...
Greetings, Ralf
"Leon Friesema" <leon@@frostbits.nl> schrieb im Newsbeitrag
news:...
> On Thu, 16 Dec 2004 12:39:36 +0100, "Ralf Müller" <>
> wrote:
>
> >
> >
> >"Leon Friesema" <leon@@frostbits.nl> schrieb im Newsbeitrag
> >news:.. .
> >> On Tue, 14 Dec 2004 09:46:28 +0100, "Ralf Müller" <>
> >> wrote:
> >>
> >> >Hi folks!
> >> >
> >> >I am developing a custom TreeView and I have got a problem with the
> >> >serialization of my TreeViewModel:
> >> >
> >> [SNIP CODE]
> >> >
> >> >The model serializes perfectly until I set my TreeViewControl to
handle
> >its
> >> >DataChangedEvent. Then I get the following exception:
> >> >"Der Typ 'julitec.DM.Web.NavigationTreeModel' muss als 'Serializable'
> >> >markiert sein oder einen anderen TypeConverter als ReferenceConverter
> >> >haben." (= The type 'julitec.DM.Web.NavigationTreeModel' must be
marked
> >as
> >> >Serializable or have a TypeConverter other than ReferenceConverter)
> >> >I guess that is because my TreeViewControl is not serializable.
> >> >What I am asking myself (and you) now is the following: Should I
really
> >make
> >> >a Control serializable? I don't think it is a good pratice to do so
since
> >> >none of the built in ASP.NET WebControls seems to be serializable.
What
> >else
> >> >could I do to overcome this problem?
> >> >
> >> >Thanx in advance!
> >> >
> >> >
> >> >
> >> >Greetings, Ralf
> >> >
> >>
> >> That indeed is the problem, the control isn't serializable and no, you
> >> don't want it to be.
> >> What you want to do, if you want to serialize the data is handle the
> >> control and data seperately. When a change has occured in the Control,
> >> you post it back to your data and serialize that.
> >> One minor problem though, when de-serializing you need to rewrite your
> >> code because it needs to repopulate the control.
> >>
> >> Leon.
> >
>
> >hi leon!
> >
> >my problem is that i want to notify my control of changes that occur to
the
> >model - not the other way round
> >but i have got no idea how to send an event or any kind of notifcation to
my
> >control if i can't let it handle my model events because it is not
> >serializable...
> >
> >could you give me an example of what you where proposing?
> >
> >
> >ralf
>
> Ralf,
>
> what do you mean by notify my control?
> If you mean you added a Node to the TreeView == change to the Model.
> In that case, why don't you override the methods of the node-changes
> (add, remove, etc) and handle these events also within your
> (serializable) model.
>
> Leon.