Web.GetSubwebsForCurrentUser - Méthode
Returns the collection of child sites of the current site based on the specified query.
Espace de noms : Microsoft.SharePoint.Client
Assemblys : Microsoft.SharePoint.Client.Silverlight (dans Microsoft.SharePoint.Client.Silverlight.dll); Microsoft.SharePoint.Client.Phone (dans Microsoft.SharePoint.Client.Phone.dll) Microsoft.SharePoint.Client (dans Microsoft.SharePoint.Client.dll)
Syntaxe
'Déclaration
Public Function GetSubwebsForCurrentUser ( _
query As SubwebQuery _
) As WebCollection
'Utilisation
Dim instance As Web
Dim query As SubwebQuery
Dim returnValue As WebCollection
returnValue = instance.GetSubwebsForCurrentUser(query)
public WebCollection GetSubwebsForCurrentUser(
SubwebQuery query
)
Paramètres
query
Type : Microsoft.SharePoint.Client.SubwebQuerySpecifies which child sites to return.
Valeur renvoyée
Type : Microsoft.SharePoint.Client.WebCollection
Returns WebCollection.
Remarques
If the query is not valid, the server must return an empty collection.
Exemples
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);
}
}
}