1

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

Eg.

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

How to achieve ?

1

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

Hope it helps :).

1

you can use WebsInfo property of SPWebCollection class

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

then you can perform action with SPWebInfo class.

0

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.