Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

subsite's title & lists inside these subsites

$
0
0

Hello everyone I have actually 2 questions; 

first one is; 

I want to get all subsites, their urls and titles, (in a specific web scope)

second one is ;

I want to get these subsites's all lists. 

I applied this but returns me null. any suggessions?

using (SPSite site = new SPSite(SPContext.Current.Site.Url))
             {
                 using (SPWeb web = site.OpenWeb(WebUrls.Blog))
                 {
                    // query.Webs = "<Webs Scope='SiteCollection' />";
                     query.Webs = "<Webs Scope=\"Recursive\">";
                     query.Lists = "<Lists ServerTemplate=\"105\" />";
                     query.ViewFields = "<FieldRef Name=\"Title\" />";
                  
                     DataTable dt = web.GetSiteData(query);


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>