我试图弄清楚如何获取用于特定页面的页面布局,但是没有使用vail。如何从SharePoint Online中的项目获取页面布局
我使用的代码是:
public void ItemAddedHandler(ClientContext clientContext, Guid listId, int listItemId) {
var web = clientContext.Web;
List list = clientContext.Web.Lists.GetById(listId);
ListItem item = list.GetItemById(listItemId);
clientContext.Load(item, i => i["PublishingPageLayout"]);
// item["PublishingPageLayout"] should contain the Page Layout used but is empty.
}
什么我错在这里做什么?
我已经做了一个测试,并检查“PublishingPageLayout”属性上的删除也,然后我可以得到文件的页面布局。奇怪。似乎布局没有完全设置项目添加(我正在使用事件接收器触发创建该文件中的代码) –