This topic has not yet been rated - Rate this topic

RecentChangesMenu Class

This control generates a list of recently changed wiki pages in the wiki library.

System.Object
  System.Web.UI.Control
    Microsoft.SharePoint.WebControls.SPControl
      Microsoft.SharePoint.WebControls.TemplateBasedControl
        Microsoft.SharePoint.WebControls.RecentChangesMenu

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class RecentChangesMenu : TemplateBasedControl
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
RecentChangesMenu
Description 

The Microsoft.SharePoint.WebControls.RecentChangesMenu inherits from the Microsoft.SharePoint.WebControls.TemplateBasedControl class which allows deriving specific types of template-rendered controls. 

The RecentChangesMenu control is most evident in the shipped SharePoint software on the left hand side of Wiki pages noted with the header "Last Modified". This placement can be examined further by opening the template located at \TEMPLATE\DocumentTemplates\wkpstd.aspx. Within this file, you will find a SharePoint:RecentChangesMenu tag which represents this control call.

RecentChangesMenu functions by building two separate controls that simply build out links. One control is of type System.Web.UI.WebControls.HyperLink that points to the "Recent Changes" WebForm located at /Forms/RecentChanges.aspx. The second control is of type Microsoft.SharePoint.WebControls.SPLinkButton that points to the "All Pages" URL provided by the SPList.DefaultViewUrl property for the current SPContext.

Usage Scenario

The primary usage of RecentChangesMenu is found in default document templates. However, if the appropriate context is obtainable, it is feasible to use the object in custom controls.

In the below, I am demonstrating creating a new RecentChangesMenu control within CreateChildControls, and then adding it to the current instance control collection. 

C# Code Example 

protected override void CreateChildControls()
{
RecentChangesMenu menu = new RecentChangesMenu();
Controls.Add(menu);
}

Visual Basic .NET Code Example

Protected Overloads Overrides Sub CreateChildControls()
Dim menu As New RecentChangesMenu()
Controls.Add(menu)
End Sub