Loading ...
Sorry, an error occurred while loading the content.

YUI Treeview and ASP.Net Postback

Expand Messages
  • Patrick Burrows
    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
    Message 1 of 2 , Dec 30, 2007
    • 0 Attachment
      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?

      Thanks!
    • Patrick Burrows
      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
      Message 2 of 2 , Dec 31, 2007
      • 0 Attachment
        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
        ToXml() method.

        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?
        >
        > Thanks!
        >



        --
        --
        Patrick Burrows
        http://www.CleverHumans.com
      Your message has been successfully submitted and would be delivered to recipients shortly.