2
尋呼在這裏不起作用,它說錯誤:不支持查詢表達式。 此行發生錯誤:
clientContext.Load(listItems,itms => itms.Skip((PageNumber - 1)* PageSize).Take(PageSize));尋呼問題SP 2010與C#
有人可能會提醒嗎?
感謝
/// <summary>
/// Method to return list of documents of a specific document library
/// </summary>
/// <param name="docLibaryName"></param>
/// <returns></returns>
public List<Document> GetDocumentsByLibraryName(string spURL, string docLibaryName, int PageSize, int PageNumber)
{
List<Document> docList = new List<Document>();
//Access the Document Library
ClientContext clientContext = new ClientContext(spURL);
List sharedDocumentsList = clientContext.Web.Lists.GetByTitle(docLibaryName);
//Specify the Caml Query
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml =
@"<View Scope='Recursive'></View>";
ListItemCollection listItems = sharedDocumentsList.GetItems(camlQuery);
clientContext.Load(listItems, itms => itms.Skip((PageNumber - 1) * PageSize).Take(PageSize));
clientContext.ExecuteQuery();
AddItemsToDocumentCollection(docList, listItems);
return docList.ToList();
}
如何使用這種方法可以實現尋呼?我需要看看其他一些方法嗎? –
@HariGillala請參閱編輯。 – Servy
如果它爲空,那麼沒有下一頁。謝謝,這是一個很好的提示,因爲在頁面結束後返回是不可能的。至少它似乎是。 –