This demo shows how to use TreeView populate tree nodes from remote feature to load the remote server folders on demand.
TreeView offers ClientBind methods to implatement ajax load.<% <% Ajax.Dna().TreeView("treeview1") .SinglePathExpand(true) .Options(opts => { //Handling the node populate events. opts.OnNodePopulate = (new StringBuilder()) .Append("var $n = $(node);") .Append("$n.addClass(\"d-treenode-loading\");") .Append("var url = $(\">.d-treenode-content>a\", $n).attr(\"rel\");") .Append("$(\"#treeview1\").dtree(\"loadNodes\", url, \"POST\", {}, $n);") .Append("$n.removeClass(\"d-treenode-hasChildren\");") .ToString(); opts.OnNodeLoaded = "if (node) { $(node).removeClass(\"d-treenode-loading\"); } "; }) .ClientBind("Your remote url here"), () => { /*Here is return a JSON array object that contains and object like: { hasChildren:bool, url:string, rel:string, imgUrl:string, title:string } */ %> <li { {if hasChildren} } class="d-treenode-hasChildren" { {/if} }> <a href="${url}" { {if rel} } rel="${rel}" { {/if} }> <img src="${imgUrl}" class="d-treenode-img" alt="${title}" /> <span class="d-treenode-text">${title}span> a> li> <% }) .Render(); %>