您的位置:首页 > 其它

SharePoint online ClientContext

2015-07-24 10:58 417 查看
1. The default class

Ina SharePoint provided-hosted project, as the project is built, the defaultSharePointContext.cs will be created in the 'Web Project' of the App project

And in this class, there is a function named 'GetSharePointContext', the default function is as follows:
public SharePointContext GetSharePointContext(HttpContext httpContext)
{
return GetSharePointContext(new HttpContextWrapper(httpContext));
}
Usually,we will store the clientContext in the session to re-use it. However,sometimes, the session will be expired.

2. The function in use

After a long research, we decide to use the following method to get the ClientContext:



3. How to get the parameter 'SPHostUrl'

3.1 At the front-end



3.2 At the back-end

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: