Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Authorization on SPWebCollection.Webs

Status
Not open for further replies.

jareddev

Programmer
Nov 22, 2006
1
GB
Hi all,

I hope someone can help?

I get a 401.5 error when i try to retrieve the Names public property of the SPWebCollection class.

Code:
SPSite siteColl = new SPSite(targetWebSite.Url);
SPWeb site = siteColl.OpenWeb();
SPWebCollection siteCollection = site.Webs;

// Return just the server relative URLs if requested.
if (bServerRelativeURL)
{
return siteCollection.Names;
}

Can anyone tell me why or a workaround for this, if i give the user contributer to the site then the code runs fine but i cannot understand why i can run some code before i get the 401.

Best Regards
Jared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top