RibbonControllerAddRibbonTabToPage Method |
Namespace: FluentRibbon
public void AddRibbonTabToPage( TabDefinition definition, Page page, bool makeInitial )
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.
Example of usage:
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.