Tuesday, July 14, 2009

“Open tool pane” link in Web Part for SharePoint

If you want to display “Open tool pane” link in Web Part for SharePoint, just like the one displayed in the Content Editor Web Part and several others out-of-the-box Web Parts. Then add the following JavaScript code to your Web Part class:

lblErrorMessage.text = "<a href=\"javascript:MSOTlPn_ShowToolPane2Wrapper('Edit', this,'" + this.ID + "')\">Open tool pane</a>"

Get source code here:


  • Figure 1: Display “Open tool pane” link in the Web Part content


  • Figure 2: User clicked on the “Open tool pane” link


No comments: