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

SPSite.Exists method (Uri, Boolean)

SharePoint 2013

Determines if a site with the specified uri exists. Checks the config db cache and, additionally, checks the content database if checkContentDb is true.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
public static bool Exists(
	Uri uri,
	bool checkContentDb
)

Parameters

uri
Type: System.Uri

The exact, absolute url of a site. i.e. http://server/sites/sitename, not http://server/sites/sitename/subweb/default.aspx

checkContentDb
Type: System.Boolean

If true, does a deep check to see if the site collection is really existing in a content database. Otherwise, just looks up the site in config db cache, which may or may not be fresh.

Return value

Type: System.Boolean
true if the site exists; otherwise, false.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.