This topic has not yet been rated - Rate this topic

ModifySettingsLink Class

System.Object
  System.Web.UI.Control
    Microsoft.SharePoint.WebControls.ModifySettingsLink

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class ModifySettingsLink : Control
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
ModifySettingsLink
Description

The Microsoft.SharePoint.WebControls.ModifySettingsLink class inherits from the System.Web.UI.Control base class. The ModifySettingsLink control is responsible for rendering a literal hyperlink tag pointing to the list settings page for the current SPList context. 

First the method will get the current list context. Following, URL testing and correction will be performed as this will be leveraged for output and must be well-formed. The massaged string will subsequently be appended to the listedit.aspx path, using the harvested SPList.ID to act as they list query string identifier.

The control output is a literal hyperlink tag that takes on the form:

SPWeb.ServerRelativeUrl + /_layouts/listedit.aspx?List= + Current List Instance ID

It is important to note that the control uses the current context to get the SPList object, it is not a mutable parameter. 

The Usage Scenario

The most ordinary usage of ModifySettingsLink, since it is limited to executing within a list context, is providing navigational elements on SharePoint list WebForms. For example, as opposed to relying on users selecting the list settings link from within the orthodox SharePoint list menu, you could manufacture a small WebPart to render a hyperlink to it to place in a more conspicuous position.

In the below example I am creating a new ModifySettingsLink object and adding it to the control collection.

C# Code Example

protected override void CreateChildControls()
{
ModifySettingsLink link = new ModifySettingsLink();
Controls.Add(link);
base.CreateChildControls();
}

Visual Basic .NET Code Example

Protected Overloads Overrides Sub CreateChildControls()
Dim link As New ModifySettingsLink()
Controls.Add(link)
MyBase.CreateChildControls()
End Sub