当我尝试按 id 执行获取列表项时出现错误
ClientContext clientContext = TokenHelper.GetClientContextWithAccessToken(sharepointUrl.ToString(), accessToken);
Web web = clientContext.Web;
clientContext.Load(web);
clientContext.ExecuteQuery();
clientContext.Load(web.CurrentUser);
clientContext.ExecuteQuery();
currentUser = clientContext.Web.CurrentUser.Title;
List _list = web.Lists.GetById(_ListGuid);
clientContext.Load(_list);
clientContext.ExecuteQuery();
Microsoft.SharePoint.Client.ListItem _item = _list.GetItemById(ItemID);
clientContext.Load(_item);
clientContext.ExecuteQuery(); //ERROR HERE
Response.Write(_item["Author"].ToString());
error :
项目不存在。它可能已被其他用户删除。
我已经检查过并且该项目存在。我是客户端对象模型的新手。列表对象向我显示项目数量,这很好,我不能只获取列表项目对象。
我知道这是一件非常简单的事情,但我仍然花了很多时间在这个简单的事情上。
问题出在清单文件中的权限上,当您部署应用程序时,SharePoint 会询问您“信任”,然后您必须选择要操作的列表。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)