Re: YUI Treeview and ASP.Net Postback
- Well, for posterity's sake:
The TreeView control has no native means to persist the data inside of
it. The ToString() method yields only the type name. There is no
I extended TreeView to create a ToXml() method (custom to my needs,
certainly not very full featured). It walks the tree and creates an
Xml string in the format of <node name="x"> where x is the .label of
the TextNode. I did not have to handle html, custom attributes or
other node types in my implementation.
Once I had the Xml I just escaped it, put it into a hidden field, and
posted back to the server (fairly straight forward).
On Dec 30, 2007 11:24 PM, Patrick Burrows <pburrows@...> wrote:
> I have implemented a page where users can create new items in the yui
> treeview. They can dynamically add, remove and rename new nodes.
> Now I need to be able to "save" the users data back to the server.
> When I post back the form (I am using ASP.Net) the <div> tag that the
> treeview was created on is empty.
> How can I get this data back to the server?