다음을 통해 공유


SPWeb.Title Property

Gets or sets the title for the website.

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

Syntax

'Declaration
<ClientCallableAttribute> _
<ClientCallableConstraintAttribute(Type := ClientCallableConstraintType.MaxLength, Value := )> _
Public Property Title As String
    Get
    Set
'Usage
Dim instance As SPWeb
Dim value As String

value = instance.Title

instance.Title = value
[ClientCallableAttribute]
[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.MaxLength, Value = )]
public string Title { get; set; }

Property Value

Type: System.String
A string that contains the title.

Remarks

The value that is returned can vary depending on the current thread's Thread.CurrentUICulture property. For more information, see the TitleResource property.

Examples

The following code example uses the Title property to change the title of a specified website in the current site collection.

Using webSite As SPWeb = SPContext.Current.Site.OpenWeb("Website_URL")
    webSite.Title = "New_Site_Name"

    webSite.Update()
End Using
using(SPWeb oWebsite = SPContext.Current.Site.OpenWeb("Website_URL"))
{
    oWebsite.Title = "New Website Name";
    oWebsite.Update();
}

See Also

Reference

SPWeb Class

SPWeb Members

Microsoft.SharePoint Namespace

TitleResource