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)
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
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(); }
Note: |
|---|
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 Best Practices: Using Disposable Windows SharePoint Services Objects. |
Note: