Created
December 27, 2017 15:22
-
-
Save Vintaurus/408ebce67bb37021127b9c4204702bd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Page_Load(object sender, EventArgs e) | |
{ | |
// The following code gets the client context and Title property by using TokenHelper. | |
// To access other properties, the app may need to request permissions on the host web. | |
var spContext = SharePointContextProvider.Current.GetSharePointContext(Context); | |
using (var clientContext = spContext.CreateUserClientContextForSPHost()) | |
{ | |
clientContext.Load(clientContext.Web, web => web.Title); | |
clientContext.ExecuteQuery(); | |
Response.Write(clientContext.Web.Title); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment