I am using ASP.NET MVC to build my application. I have a treeview (with treenodes having hrefs) in the masterpage and when click on the treenode corresponding page get loaded in the content view. I need this to happen asynchronously. Also I need to persist the state of the tree(i.e. expand / collapse of each nodes) after each node click.
Share
with regards to activating a click event on an element you need to either know its id or class name.
so to activatea click event on an element with a class of “treeNode” use;
to do a postback to a controller actionresult, use;
retHTML above is what is returned from the ajax post.
in your controller do this;
I would, from my controller, i would return a partialview.
In the jQuery success code I would replace, append, whatever, the retHTML to where I wanted it.