Поделиться через


Метод Web.GetSubwebsForCurrentUser

Returns the collection of child sites of the current site based on the specified query.

Пространство имен:  Microsoft.SharePoint.Client
Сборки:   Microsoft.SharePoint.Client.Silverlight (в Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (в Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (в Microsoft.SharePoint.Client.dll)

Синтаксис

'Декларация
Public Function GetSubwebsForCurrentUser ( _
    query As SubwebQuery _
) As WebCollection
'Применение
Dim instance As Web
Dim query As SubwebQuery
Dim returnValue As WebCollection

returnValue = instance.GetSubwebsForCurrentUser(query)
public WebCollection GetSubwebsForCurrentUser(
    SubwebQuery query
)

Параметры

Возвращаемое значение

Тип: Microsoft.SharePoint.Client.WebCollection
Returns WebCollection.

Замечания

If the query is not valid, the server must return an empty collection.

Примеры

This code example displays the titles of the child sites of the specified site.

using System;
using Microsoft.SharePoint.Client;

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

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;
            WebCollection collWeb = site.GetSubwebsForCurrentUser(null);

            clientContext.Load(collWeb);
            clientContext.ExecuteQuery();

            Console.WriteLine("Child sites: \n\n");
            foreach (Web oneWeb in collWeb)
               Console.WriteLine(oneWeb.Title);
        }
    }
}

См. также

Справочные материалы

Web класс

Элементы Web

Пространство имен Microsoft.SharePoint.Client