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

SPSite.OpenWeb Method (String, Boolean)

Returns the Web site that is located at the specified server-relative or site-relative URL based on a Boolean value that specifies whether the exact URL must be supplied.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

public SPWeb OpenWeb(
	string strUrl,
	bool requireExactUrl


Type: System.String

A string that contains either the server-relative or site-relative URL of the Web site or of an object within the Web site. A server-relative URL begins with a forward slash ("/"), while a site-relative URL does not begin with a forward slash.

Type: System.Boolean

true if an exact URL must be supplied; otherwise false.

Return Value

Type: Microsoft.SharePoint.SPWeb
An SPWeb object that represents the Web site.
© 2015 Microsoft