Created
November 27, 2014 15:08
-
-
Save pbjorklund/822cc9f4cb2b75b741a5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var qsKeys = Request.QueryString.AllKeys; | |
| if (qsKeys.Contains("SPAppWebUrl")) | |
| { | |
| AppWebUrl.Value = Request.QueryString["SPAppWebUrl"]; | |
| } | |
| else | |
| { | |
| var rootUri = new UriBuilder(String.Concat(new Uri(Request.QueryString["SPHostUrl"]).Authority, "/sites/apps")) | |
| { | |
| Scheme = Uri.UriSchemeHttps, | |
| Port = 443 | |
| }; | |
| SharePointOnlineHelper.RunInNewAppOnlyContext(rootUri.ToString(), appCtx => | |
| { | |
| var web = appCtx.Web; | |
| var appInstances = web.GetAppInstances(); | |
| var target = appCtx.LoadQuery(appInstances.Where(a => a.Title == "Site Konfigurator")); | |
| appCtx.ExecuteQuery(); | |
| AppWebUrl.Value = target.Single().AppWebFullUrl; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And then pick it up via a asp hiddenfield