SPRibbon.GetCurrent Method
Returns the ribbon that exists on the specified page.
Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Shared Function GetCurrent ( _
page As Page _
) As SPRibbon
'Usage
Dim page As Page
Dim returnValue As SPRibbon
returnValue = SPRibbon.GetCurrent(page)
public static SPRibbon GetCurrent(
Page page
)
Parameters
page
Type: System.Web.UI.PageThe page from which to get the ribbon.
Return Value
Type: Microsoft.SharePoint.WebControls.SPRibbon
Returns SPRibbon.
Remarks
The ribbon control can be accessed after OnInit event fires, but it cannot be manipulated or changed other than to show or hide it. This is because the ribbon control registers itself during the OnInit event.