I want to get all webs including it's subwebs.


  1. Site
    1. web1
      1. subweb1
      2. subweb2
    2. web2

How to achieve ?


Its all happening in SharePoint Manager, just download source code and look at code to get what you want.

Hope it helps :).


you can use WebsInfo property of SPWebCollection class

var list = SPContext.Current.Site.AllWebs.WebsInfo;

then you can perform action with SPWebInfo class.


This is one solution, which will return all sites including its subsite.

SPWebCollection allwebcoll = spsite.AllWebs;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.