With ASP controls, like Telerik Controls, you have the Serverside which is referenced and the markup sent to the client. I was trying to do something NEW with it.
I have an ajax call which would return a json object of a MODAL. This modal will contain a TreeView. From what I was looking up, is that if i were to do this it wouldnt actually have a backend to reference, as it is essentially pinging the server for some 1time use output.
I am trying to change that. Whawt my goal is to make the ajax ping to build the TV and then on each subsequent node expansion, return all the children of the clicked Node? Sound easy right? Well, Not from the way I am doing it.
My ajax requests were just going to return a string, which is parsed with jQuery into HTML, and then inserted into the modal. I was trying various things such as:
StringWriter writer = new StringWriter();
HtmlTextWriter tOut = new HtmlTextWriter(writer);
ddFieldFilter.RenderControl(tOut);
tvFields = new RadTreeView();
tvFields.NodeExpand += new RadTreeViewEventHandler(tvFields_NodeExpand);
tvFields.NodeClick += new RadTreeViewEventHandler(tvFields_NodeClick);
startTree();
tvFields.RenderControl(tOut);
ret += writer.ToString();
This isnt working in the way I wanted to, and it will crash. It wont let me do a toString on the TreeView to put the markup into a string.
Sidenote: The tree doesnt NEED to be preservced, but if you could take the tree and send it back to the server for an update and then return it that works too.
I was thinking that after the tree was printed, i would then, on each leaf, just do an ajax request for TreeViewNodes, or.... something similar.
Thoughts? Ideas? From what I was looking at, and my thought processes, You CANNOT have a DIV be the target of a webserver for updates. That is more like a frame sort of thing, which i COULD do.... put a frame IN a div, but Im trying to keep it all looking nice, without frames.