.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

SPWebCollection from URL

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :SharePoint
 

It seems simple, but i cant fugure out how can i get SPWebCollectionfrom URL like:

http://localhost/level1site

which will include it and all of it subsites:

http://localhost/level1site

http://localhost/level1site/level2site

http://localhost/level1site/level2site/level3site

 

I start so:

            SPSite launchsite = new SPSite(textBox1.Text);           

            SPWeb launchweb = launchsite.OpenWeb();                   

            SPWebCollection mywebcollections = launchweb.Webs;

But .Webs gets only 1 level subsite excluting root. It doesnt fit.

            SPWebCollection mywebcollections = launchsite.AllWebs;

AllWebs get all sites ignoring startURL.




View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend