PublishingPage.LocalContactName Property
Gets or sets a name that identifies the local contact of this PublishingPage object.
Namespace: Microsoft.SharePoint.Publishing
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax
'Declaration
Public Property LocalContactName As String
Get
Set
'Usage
Dim instance As PublishingPage
Dim value As String
value = instance.LocalContactName
instance.LocalContactName = value
public string LocalContactName { get; set; }
Property Value
Type: System.String
A name that identifies the local contact of this PublishingPage object.
Exceptions
Exception | Condition |
---|---|
[System.ArgumentNullException] | Indicates that the value being set is a null reference (Nothing in Visual Basic), which is invalid. |
[System.ArgumentException] | Invalid property value. The value cannot exceed 255 characters. |
[System.UnauthorizedAccessException] | Current user does not have sufficient permissions to perform this action. |
Remarks
The Contact property is the preferred property for tracking an SPUser who owns a PublishingPage. However, if no Contact is specified, then PublishingPage-specific user information is provided through the LocalContactName, LocalContactEmail and LocalContactImage properties. These values are relevant only for the given PublishingPage, and have no effect on any SPUser objects in the site.
The Contact property is mutually exclusive from the LocalContactName, LocalContactEmail, and LocalContactImage properties. Setting the LocalContactName, LocalContactEmail, or LocalContactImage properties to a non-empty, non-null value clears the Contact property. Similarly, setting the Contact property to a non-null value clears the LocalContactName, LocalContactEmail, and LocalContactImage properties.
The PublishingPage.LocalContactName value is usually used only for user interface (UI) display purposes, so it does not need to match any existing SPUser names.
The value cannot exceed 255 characters. Any excess characters cause the system to throw a System.ArgumentException exception. The value can be an empty string.
If this property value is used in HTML that will be rendered in a browser, you should encode the property value in HTML to avoid the possibility of scripting attacks.
To save changes after setting this property, call the Update method.
To set this value, the user must have both View and Edit permissions on the PublishingPage: View permissions to retrieve the page and to return its property values, and Edit permissions to change the value.