liorlankril
Programmer
I have a web part code (in c#) that try to get to specific List that appear in several Webs (Sub areas) in the portsl. the List name is equal in all instances of the list (called "MyList").
In my code I try to search all instance of this List:
SPSite site = SPControl.GetContextSite(Context);
SPWebCollection allwebs =site.AllWebs;
foreach (SPWeb singalweb in allwebs)
{
SPListCollection lists =singalweb.Lists;
//Search the specific list ("MyList").
}
Or this code:
SPWeb MainWeb=site.AllWebs[""];
SPWebCollection webcoll=MainWeb.GetSubwebsForCurrentUser();
foreach(....){...}
The problem is:
When I arrive to Sub area (Web) with this URL:
I can find the specific list
But when the URL is type of:
(Or C1...and so)
I get a prompt of User and Password to the server.. It's like I dont have permmision to C1,C2 and so....
It's work only if I'm Administrator on the server (but I dont want all the portal's users to be Administrators on the server).
What is the solution?? How to find all instance of the specific list??
In my code I try to search all instance of this List:
SPSite site = SPControl.GetContextSite(Context);
SPWebCollection allwebs =site.AllWebs;
foreach (SPWeb singalweb in allwebs)
{
SPListCollection lists =singalweb.Lists;
//Search the specific list ("MyList").
}
Or this code:
SPWeb MainWeb=site.AllWebs[""];
SPWebCollection webcoll=MainWeb.GetSubwebsForCurrentUser();
foreach(....){...}
The problem is:
When I arrive to Sub area (Web) with this URL:
I can find the specific list
But when the URL is type of:
(Or C1...and so)
I get a prompt of User and Password to the server.. It's like I dont have permmision to C1,C2 and so....
It's work only if I'm Administrator on the server (but I dont want all the portal's users to be Administrators on the server).
What is the solution?? How to find all instance of the specific list??