PersonalActions Class
System.Object
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.TemplateBasedControl
Microsoft.SharePoint.WebControls.ToolBarMenuButton
Microsoft.SharePoint.WebControls.PersonalActions
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.TemplateBasedControl
Microsoft.SharePoint.WebControls.ToolBarMenuButton
Microsoft.SharePoint.WebControls.PersonalActions
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
PersonalActions
Description
The Microsoft.SharePoint.WebControls.PersonalActions class inherits from the IPreRenderOverride interface to contract the PreRender override and the Microsoft.SharePoint.WebControls.ToolBarMenuButton to represent a menu button. PersonalActions is more widely known as the "Welcome Menu" because Welcome.ascx has a PersonalActions control and is included in the default master pages.
The PersonalActions control uses several MenuItemTemplate objects in order to build a presentation layer. In order to build the required authentication pieces there are several security tests that are performed in order to determine what MenuItemTemplate to toggle based on conditions such as SPSecurity.AuthenticationMode and personalization elements.
The Usage Scenario
The primary usage of PersonalActions is internal since the class is sealed so cannot be used for derivation. Use of the control within custom development is also found mostly as a reference in master pages or as a value for Microsoft.SharePoint.StandardMenu.Group.ID property. Regardless, PersonalActions can be used in the same manner as any other WebControl.
In the below, I am creating a new PersonalActions object and assigning the control a unique ID. Following, I am adding the PersonalActions control to the current instance control collection.
C# Code Example
protected override void CreateChildControls()
{
PersonalActions actions = new PersonalActions();
actions.ID = "MyActions";
Controls.Add(actions);
}
Visual Basic .NET Code Example
Protected Overloads Overrides Sub CreateChildControls()
Dim actions As New PersonalActions()
actions.ID = "MyActions"
Controls.Add(actions)
End Sub
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
The Microsoft.SharePoint.WebControls.PersonalActions class inherits from the IPreRenderOverride interface to contract the PreRender override and the Microsoft.SharePoint.WebControls.ToolBarMenuButton to represent a menu button. PersonalActions is more widely known as the "Welcome Menu" because Welcome.ascx has a PersonalActions control and is included in the default master pages.
The PersonalActions control uses several MenuItemTemplate objects in order to build a presentation layer. In order to build the required authentication pieces there are several security tests that are performed in order to determine what MenuItemTemplate to toggle based on conditions such as SPSecurity.AuthenticationMode and personalization elements.
The Usage Scenario
The primary usage of PersonalActions is internal since the class is sealed so cannot be used for derivation. Use of the control within custom development is also found mostly as a reference in master pages or as a value for Microsoft.SharePoint.StandardMenu.Group.ID property. Regardless, PersonalActions can be used in the same manner as any other WebControl.
In the below, I am creating a new PersonalActions object and assigning the control a unique ID. Following, I am adding the PersonalActions control to the current instance control collection.
C# Code Example
protected override void CreateChildControls()
{
PersonalActions actions = new PersonalActions();
actions.ID = "MyActions";
Controls.Add(actions);
}
Visual Basic .NET Code Example
Protected Overloads Overrides Sub CreateChildControls()
Dim actions As New PersonalActions()
actions.ID = "MyActions"
Controls.Add(actions)
End Sub
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
- 6/3/2010
- Adam Buenz - MVP