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

SPFolder.WelcomePage property

Gets or sets the URL to which users are redirected when they browse to the folder.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[ClientCallableAttribute]
[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.NotNull)]
public string WelcomePage { get; set; }

Property value

Type: System.String
A string that contains the URL to which users are redirected. For a wiki site, the string specifies a site-relative URL, for example, MyWikiFolder/MyWelcomePage.aspx, but for a wiki library, the string specifies a folder-relative URL, for example, MyWelcome.aspx.

The following example sets the site-relative URL of an item in a wiki library as the Welcome page that is used for the wiki site.

using (SPSite oSiteCollection = new SPSite("http://MyServer/sites/MyWikiSite"))
{
    SPWeb oWebsite = oSiteCollection.OpenWeb();
    SPFolder oFolder = oWebsite.RootFolder; 
    oFolder.WelcomePage = "My Wiki Library/MyWelcome.aspx";
    oFolder.Update();
    oWebsite.Dispose();
}
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.