I am trying to loop through all webs and subs-webs of those webs under a web.
My Parent web
http://EXAMPLE.com/parentweb (This is a sub site not a root web)
sub webs http://example.com/parentweb/subweb ( This is one of the sub web which may or may not have sub webs)
The only thing i tried is go to the site collection and loop throug all webs which is much longer process because i know the only sub site that needs to be checked. my site collection has multiple sub sites. i don't want to loop through all subs sites.
This code works but it takes so much of time and it loops through all subsites which don't need to be checked
using(SPSite site = new SPSite(“http://myserver/mysitecol”)
{
foreach(SPWeb web in site.AllWebs)
{
}
}