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
)
パラメーター
query
型: Microsoft.SharePoint.Client.SubwebQuerySpecifies which child sites to return.
戻り値
型: 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);
}
}
}