SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 7 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


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.