How to get all the subsites(not just immediately beneath the top level site, but all child site) in a site collection in sharepoint 201 using CSOM

Hi all,

Is there any API in CSOM using which i can get all the subsites in a site collection using CSOM. I tried with "web.webs"(https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.web.webs(v=office.14).aspx), but this will give only the immediate child subsite. What i am looking for is to get all the child subsite, not just immediate child subsite.

Thanks,

Sh

March 18th, 2015 12:26am

Hi,

Spservices does the job for you. here you

$().SPServices
  ({
     operation: "GetAllSubWebCollection",
     webURL: "http://mydemosite",                     
     completefunc: function (xData, status)
     {
       $(xData.responseXML).find("Web").each(function()
       {
          alert($(this).attr("Title"));

          
        });
      }

http://spservices.codeplex.com/

Free Windows Admin Tool Kit Click here and download it now
March 18th, 2015 2:28am

Hi,

You can refer to the article:

https://social.msdn.microsoft.com/Forums/office/en-US/dda4008b-d1ad-46ce-83b2-090d7f14ee3e/how-to-get-subsites-using-client-object-model?forum=sharepointdevelopmentlegacy

March 18th, 2015 2:43am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics