SPWebApplication.SelfServiceCreate method (SPWeb, String, String, String, String, String, String, Int32)
Creates SPSite or SPWeb object, depending on the self service creation mode set in the SPWebApplication, based on a simple set of input parameters. The site owner will be the user calling this method. The site will be created using the "STS#0" site template, without a description, the title will be the same as the relative URL and the LCID will match that of the input context Web. NOTE: If an Individual Site will be created, it will have unique permissions and a link to its homepage will be placed in the parent web's top navigation bar.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Function SelfServiceCreate ( _
contextWeb As SPWeb, _
siteUrl As String, _
siteTitle As String, _
siteDescription As String, _
contactLogin As String, _
contactName As String, _
contactEmail As String, _
compatibilityLevel As Integer _
) As SPWeb
'Usage
Dim instance As SPWebApplication
Dim contextWeb As SPWeb
Dim siteUrl As String
Dim siteTitle As String
Dim siteDescription As String
Dim contactLogin As String
Dim contactName As String
Dim contactEmail As String
Dim compatibilityLevel As Integer
Dim returnValue As SPWeb
returnValue = instance.SelfServiceCreate(contextWeb, _
siteUrl, siteTitle, siteDescription, _
contactLogin, contactName, contactEmail, _
compatibilityLevel)
public SPWeb SelfServiceCreate(
SPWeb contextWeb,
string siteUrl,
string siteTitle,
string siteDescription,
string contactLogin,
string contactName,
string contactEmail,
int compatibilityLevel
)
Parameters
- contextWeb
Type: Microsoft.SharePoint.SPWeb
- siteUrl
Type: System.String
- siteTitle
Type: System.String
- siteDescription
Type: System.String
- contactLogin
Type: System.String
- contactName
Type: System.String
- contactEmail
Type: System.String
- compatibilityLevel
Type: System.Int32
Return value
Type: Microsoft.SharePoint.SPWeb
SPWeb: either the actual SPWeb created for the Individual Site Creation Mode, or the root SPWeb (SPSite.RootWeb) of the new SPSite otherwise.