ToolPane.GetShowToolPaneEvent method (WebPart, ToolPane.ToolPaneView)

NOTE: This API is now obsolete.

Returns a string of ECMAScript (such as JavaScript) which, if executed on the client, causes a tool pane to open in the specified view for the specified Web Part.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
<ObsoleteAttribute("This function is deprecated. Use GetShowToolPaneEvent(WebPart webPart, WebPartDisplayMode displayMode) instead.",  _
    False)> _
Public Shared Function GetShowToolPaneEvent ( _
    webPart As WebPart, _
    view As ToolPane.ToolPaneView _
) As String
'Usage
Dim webPart As WebPart
Dim view As ToolPane.ToolPaneView
Dim returnValue As String

returnValue = ToolPane.GetShowToolPaneEvent(webPart, _
    view)
[ObsoleteAttribute("This function is deprecated. Use GetShowToolPaneEvent(WebPart webPart, WebPartDisplayMode displayMode) instead.", 
    false)]
public static string GetShowToolPaneEvent(
    WebPart webPart,
    ToolPane.ToolPaneView view
)

Parameters

Return value

Type: System.String
A string of ECMAScript (such as JavaScript) which, if executed on the client, causes a tool pane to open in the specified view for the specified Web Part.

Examples

The following overridden RenderWebPart method from a sample Web Part demonstrates the use of the GetShowToolPaneEvent method to create a list of links in the Web Part, using each available value from the ToolPane.ToolPaneView enumeration, to allow the user to invoke the various available tool pane views from the Web Part.

In the following example, "downlevel browser" refers to Internet Explorer version 5.0 and earlier, and to non-Microsoft browsers.

Protected Overrides Sub RenderWebPart(output As HtmlTextWriter)

Dim myToolPaneCall as String

myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.GalleryBrowse)
output.Write("<a href=""" + myToolPaneCall + """>Browse Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.GallerySearch)
output.Write("<a href=""" + myToolPaneCall + """>Search Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Import)
output.Write("<a href=""" + myToolPaneCall + """>Import Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Navigation)
output.Write("<a href=""" + myToolPaneCall + """>Settings Pane (Downlevel Browser)</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Error)
output.Write("<a href=""" + myToolPaneCall + """>Error Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.ExtensibleView)
output.Write("<a href=""" + myToolPaneCall + """>Extensible Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Properties)
output.Write("<a href==""" + myToolPaneCall + """>Properties Pane</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.WebPart)
output.Write("<a href=""" + myToolPaneCall + """>Chrome Menu Pane (Downlevel Browser)</a><br>")
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Closed)
output.Write("<a href=""" + myToolPaneCall + """>Close ToolPane</a><br>")

output.Write("<br>")
End Sub
protected override void RenderWebPart(HtmlTextWriter output)
{
string myToolPaneCall;

myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.GalleryBrowse);
output.Write("<a href=\"" + myToolPaneCall + "\">Browse Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.GallerySearch);
output.Write("<a href=\"" + myToolPaneCall + "\">Search Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Import);
output.Write("<a href=\"" + myToolPaneCall + "\">Import Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Navigation);
output.Write("<a href=\"" + myToolPaneCall + "\">Settings Pane (Downlevel Browser)</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Error);
output.Write("<a href=\"" + myToolPaneCall + "\">Error Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.ExtensibleView);
output.Write("<a href=\"" + myToolPaneCall + "\">Extensible Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Properties);
output.Write("<a href=\"" + myToolPaneCall + "\">Properties Pane</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(this, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.WebPart);
output.Write("<a href=\"" + myToolPaneCall + "\">Chrome Menu Pane (Downlevel Browser)</a><br>");
myToolPaneCall = Microsoft.SharePoint.WebPartPages.ToolPane.GetShowToolPaneEvent(null, Microsoft.SharePoint.WebPartPages.ToolPane.ToolPaneView.Closed);
output.Write("<a href=\"" + myToolPaneCall + "\">Close ToolPane</a><br>");

output.Write("<br>");
}

See also

Reference

ToolPane class

ToolPane members

GetShowToolPaneEvent overload

Microsoft.SharePoint.WebPartPages namespace