This is a question I can't handle, so please, give me some advice.
Here is my code for getting names of all lists:
private List<string> GetAllLists()
{
site = SPContext.Current.Site;
web = site.OpenWeb();
List<string> listNames = new List<string>();
var count = web.Lists.Count;
for (int i = 0; i < count; i++)
{
listNames.Add(web.Lists[i].Title);
}
return listNames;
}
It works, all ok. But when I want to connect to my sharepoint site from the internet or from phone, this method returns different names. All of them. Can you explain to me, why does this happens and what do I need to change?
Thanks!