Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

SPSite.PortalName property

Gets or sets the name of a portal. (Read-only in sandboxed solutions.)

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
public string PortalName { get; set; }

Property value

Type: System.String
A string that contains the portal name.

The PortalName property must be set together with the PortalUrl property to establish a connection to a portal site. The PortalUrl property must be specified first and the PortalName property second.

The following code example uses the PortalName property to establish a connection to a portal site from the specified site collection.

using (SPSite oSiteCollection = new SPSite("http://Server_Name/sites/Site_Name"))
{
    oSiteCollection.PortalUrl = "http://Portal_Site/";
    oSiteCollection.PortalName = "Portal_Name";
}
NoteNote

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.