2

I'm looking in a way to open the right side properties panel of my web part with javascript. This way when the user adds the web part to a page, a message and a button are displayed. Onclick the panel should open, like it does when clicking "Edit Web Part".

Any ideas?

1
  • which version of SharePoint?
    – Christophe
    Dec 3, 2013 at 20:45

1 Answer 1

3

The configuration panel of the web part is called Tool Pane and you can open it using this simple JavaScript snippet :

lblErrorMessage.Text = "<a href=\"javascript:MSOTlPn_ShowToolPane2Wrapper('Edit', this,'" 
            + this.Parent.ID // Id of the current webpart
            + "')\">Edit Web Part</a>";

this.Parent.ID : return the WebPart ID that contain the UserControl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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