SPHierarchyDataSourceControl and SPTreeView: can I disable standard onclientclick on a node?


  • Hi,

    I'm using a SPHierarchyDataSourceControl and a SPTreeView control in order to show the content of a document library.

    There aren't problems on that, but I need to get the selected node (when I click on it) instead of being redirected to the related document library folder.

    Any suggestions? 

    thank you

    Wednesday, June 27, 2012 7:14 PM


  • Perhaps in your master page you could add some JavaScript to hijack the click event and override it with what you want to do.  With some JQuery assistance this would look something like this:

      $("#SiteTreeViewNav a").click(function(){
        alert("Do your thing...");
        return false;

    Determination conquers all things.

    Wednesday, June 27, 2012 8:31 PM