PublishingPage.LocalContactEmail Property
Gets or sets the e-mail of the local contact for this PublishingPage object.
Namespace: Microsoft.SharePoint.Publishing
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax
'Declaration
Public Property LocalContactEmail As String
Get
Set
'Usage
Dim instance As PublishingPage
Dim value As String
value = instance.LocalContactEmail
instance.LocalContactEmail = value
public string LocalContactEmail { get; set; }
Property Value
Type: System.String
The e-mail of the local contact for the PublishingPage.
Exceptions
Exception | Condition |
---|---|
[System.ArgumentException] | Invalid property value. The value cannot exceed 255 characters. |
[System.ArgumentNullException] | Indicates that the value being set was a null reference (Nothing in Visual Basic), which is invalid. |
[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 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 specified PublishingPage and have no effect on any SPUser objects on 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.LocalContactEmail value should be a well-formed e-mail address or an empty string. The PublishingPage.LocalContactEmail value cannot exceed 255 characters. Any excess characters cause the system to throw a System.ArgumentException exception.
If this property value is used in HTML and will be rendered in a browser, you should HTML-encode the property value in HTML to avoid the possibility of scripting attacks.
Call the Update method after you set this property, in order to save the changes.
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.