Take the 2-minute tour ×

I have a custom layouts page that contains a custom visual WebPart. This WebPart wraps a XsltListViewWebPart with a toolbar. The toolbar is supplied as a RenderingTemplate. The XsltListViewWebPart provides a view on a document library. So far, everything works.

My problem is: that toolbar needs a button that when clicked calls the SharePoint "Open with Explorer" command that you get in the Ribbon menu of a document library.

<wssuc:SPToolBarButton runat="server" 
                       Text="Open with Explorer" 
                       OnClientClick="**???**" />

How can I call the "Open with Explorer" command?

share|improve this question
Why not trace what JS calls get made when you click the button from a document library? Then you can just copy the calls. You can do this in the F12 Developer Tools. –  RJ Cuthbertson Aug 14 '12 at 12:57

1 Answer 1

up vote 4 down vote accepted

You need to CoreInvoke a function called NavigateHttpFolder to achieve this.

Try using this script:

OnClientClick = "javascript:CoreInvoke('NavigateHttpFolder', yourHttpPathToOpen, '_blank');"

this is how the SP ribbon calls the Open With Explorer function. Search for NavigateHTTPFolder in view-source to check it out :)

share|improve this answer
Works like a charm, thanks a lot! –  Hatch Aug 14 '12 at 14:28

Your Answer


