SPWeb class

This class is primarily used with the PageContext class. It provides contextual information for the SharePoint site ("SPWeb") that hosts the page.

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the SPWeb class.

Properties

absoluteUrl

Returns the absolute URL for this SPWeb. Example: "https://example.com/sites/PubSite/SubWeb"

description

Returns the description of the current SPWeb.

firstDayOfWeek

Returns the web's regional first day of week setting or undefined if it hasn't been set.

id

The GUID that identifies the SPWeb on the server.

isAppWeb

Returns true if this SPWeb the container web for an SPApp.

language

Returns the locale identifier (LCID) for the default language of the website.

languageName

Returns the language name for the default language of the website.

logoUrl

Returns the absolute URL of the website logo.

permissions

Return the SPPermission object that represents the set of permissions that the current user has for interacting with the web.

serverRelativeUrl

Returns the server-relative URL for this SPWeb.

templateName

Returns the string representing the numeric identifier for the site definition or site template that was used to create the site.

timeZoneInfo

Returns the web's regional timezone settings or undefined if they haven't been set.

title

Returns the title of the current SPWeb.

Property Details

absoluteUrl

Returns the absolute URL for this SPWeb. Example: "https://example.com/sites/PubSite/SubWeb"

readonly absoluteUrl: string;

Property Value

string

description

Returns the description of the current SPWeb.

readonly description: string;

Property Value

string

firstDayOfWeek

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns the web's regional first day of week setting or undefined if it hasn't been set.

readonly firstDayOfWeek: SPDayOfWeek | undefined;

Property Value

SPDayOfWeek | undefined

id

The GUID that identifies the SPWeb on the server.

readonly id: Guid;

Property Value

isAppWeb

Returns true if this SPWeb the container web for an SPApp.

readonly isAppWeb: boolean;

Property Value

boolean

language

Returns the locale identifier (LCID) for the default language of the website.

readonly language: number;

Property Value

number

Remarks

Example: 1033 represents the locale identifier for en-US.

languageName

Returns the language name for the default language of the website.

readonly languageName: string;

Property Value

string

Remarks

Example: en-US represents the English language in the US locale.

logoUrl

Returns the absolute URL of the website logo.

readonly logoUrl: string;

Property Value

string

Remarks

Example: https://example.com/sites/PubSite/SubWeb/logo.jpg

permissions

Return the SPPermission object that represents the set of permissions that the current user has for interacting with the web.

readonly permissions: SPPermission;

Property Value

serverRelativeUrl

Returns the server-relative URL for this SPWeb.

readonly serverRelativeUrl: string;

Property Value

string

Remarks

Example: "/sites/PubSite/SubWeb"

templateName

Returns the string representing the numeric identifier for the site definition or site template that was used to create the site.

readonly templateName: string;

Property Value

string

Remarks

Example: "1" represents the team site template when creating a new site on SharePoint.

timeZoneInfo

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Returns the web's regional timezone settings or undefined if they haven't been set.

readonly timeZoneInfo: SPTimeZone | undefined;

Property Value

SPTimeZone | undefined

title

Returns the title of the current SPWeb.

readonly title: string;

Property Value

string