0

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!

pb2q
  • 58,613
  • 19
  • 146
  • 147
Viaches
  • 143
  • 1
  • 16

1 Answers1

0

Assuming you're looking at the same site when you connect, (some of the) list names may be translated and you're getting a different result depending on the language your UI is running.

See SPList.TitleResource on MSDN for an example of how to get the list name in different languages.

ErikE
  • 857
  • 8
  • 18
  • As far as i can understand, you're talking about different results for different languages. But i wrote about another lists, for example, i have two lists (clients and managers), but every time when i'm connecting via internet, they do not appear, but i can see some other lists which do not appear when i get access to my site from my program. – Viaches Jun 06 '12 at 08:16
  • When you said the program returns different names I though you meant were seeing the same lists, but that the displayed names were different. You have to clarify what you mean by connecting through the internet, do you mean browser? How that's different then what your program does? Are you sure you're looking at the same site? Try to modify your function and return web.ID and verify you see the same GUID. Are you authenticating the same way? – ErikE Jun 06 '12 at 13:24