Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SPFolder.WelcomePage Property

Windows SharePoint Services 3

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)

'Declaration
Public Property WelcomePage As String
	Get
	Set
'Usage
Dim instance As SPFolder
Dim value As String

value = instance.WelcomePage

instance.WelcomePage = value

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.

Dim siteCollection As New SPSite("http://MyServer/sites/MyWikiSite")
Try
    Dim webSite As SPWeb = siteCollection.OpenWeb()
    Dim folder As SPFolder = webSite.RootFolder
    folder.WelcomePage = "My Wiki Library/MyWelcome.aspx"
    folder.Update()
Finally
    siteCollection.Dispose()
End Try
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 Best Practices: Using Disposable Windows SharePoint Services Objects.

Community Additions

ADD
Show:
© 2015 Microsoft