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

Web Class

Represents a Microsoft SharePoint Foundation Web site.

Namespace:  Microsoft.SharePoint.Client
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

[ScriptTypeAttribute("SP.Web", ServerTypeId = "{a489add2-5d3a-4de8-9445-49259462dceb}")]
public class Web : SecurableObject

This code example displays information about a subweb.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
    class WebExample
        static void Main()
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;


            Console.WriteLine("Site information: \n\n");
            Console.WriteLine("Title: {0}", site.Title);
            Console.WriteLine("ID: {0}", site.Id);
            Console.WriteLine("Language: {0}", site.Language);
            Console.WriteLine("UI Version: {0}", site.UIVersion);
            Console.WriteLine("Description: {0}", site.Description);
            Console.WriteLine("Created: {0}", site.Created);

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft