0

how to obtain the list name through cross-domain CSOM Provided that I have the list GUID. Any easy way for the conversion ?

1
  • 1
    Would you share your code please. I think you need to make some ajax calls for that. Nov 2, 2015 at 7:47

1 Answer 1

0

You can get a list name from SharePoint using CSOM using below mentioned code.

using System;
using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointServices.Samples
{
    class RetrieveAllListProperties
    {
        static void Main()
        {
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web oWebsite = clientContext.Web;
            ListCollection collList = oWebsite.Lists;

            clientContext.Load(collList);

            clientContext.ExecuteQuery();

            foreach (SP.List oList in collList)
            {
                Console.WriteLine("Title: {0} Created: {1}", oList.Title, oList.Created.ToString());
            }
        }
    }
}

If you are working with cross domain environment than you must have to use JavaScript. You can get idea from Complete basic operations using JavaScript library code in SharePoint 2013

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.