Click or drag to resize
RibbonControllerAddRibbonTabToPage Method
Add ribbon tab to the specified page

Namespace: FluentRibbon
Assembly: FluentRibbon (in FluentRibbon.dll) Version: 1.0.5338.15939
Syntax
C#
public void AddRibbonTabToPage(
	TabDefinition definition,
	Page page,
	bool makeInitial
)

Parameters

definition
Type: FluentRibbon.DefinitionsTabDefinition
Definition of the ribbon tab
page
Type: System.Web.UIPage
Page, to which the definition will be added
makeInitial
Type: SystemBoolean
if true, the ribbon tab will be active when page is loaded, otherwise the default tab (Browse) will be active
Remarks

This method is intended to provide ability to add local ribbon customizations. The customizations have to be specified each time when the page gets loaded. To add permanent customizations, use RibbonCustomAction.

This method cannot create contextual tabs, only static.

Examples

Example of usage:

C#
public class MyPage : LayoutsPageBase
{
    public void Page_Load(object sender, EventArgs e)
    {
        RibbonController.Current.AddRibbonTabToPage(MyRibbonManager.MyTabDefinition, this, true);
    }
}

This will add initially active ribbon tab to the application page MyPage. Tab definition is supposed to be stored in some custom user class MyRibbonManager.

Also its possible to use this method for adding tabs to ribbon from webparts. But you must provide different ribbon ids for different webparts and even for different instances of the same webpart.

See Also