Skip to main content
1 of 2
Vadim Gremyachev
  • 42.6k
  • 3
  • 87
  • 169

How to get List by Url using SharePoint 2013 CSOM

SharePoint 2013 CSOM API contains the following methods for accessing List object:

For example:

var listTitle = "Tasks";
using(var ctx = new ClientContext(webUrl))
{
     var list = ctx.Web.Lists.GetByTitle(listTitle);
     ctx.Load(list);
     ctx.ExecuteQuery();
}

From another hand, SSOM API contains SPWeb.GetList method to gets the list that is associated with the specified server-relative URL.

The question is: how to effectively to load List by server-relative URL in CSOM?

Vadim Gremyachev
  • 42.6k
  • 3
  • 87
  • 169