Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

ContextToken null after post back

$
0
0

Greetings.  I'm developing a provider-hosted 2013 app for Office 365.  I can successfully build and deploy the app to my developer site.  The code I'm using is a sample app from MSDN (http://msdn.microsoft.com/en-us/library/fp142381.aspx).  My problem is that the code that runs in Page_Load works, but if I bind any code to a control (i.e. a button) in an event handler, the ContextToken is always null.  The following code, inside an event handler (after post back), always results in null context token but works in the Page_Load:

var contextToken = TokenHelper.GetContextTokenFromRequest(Page.Request);
if(contextToken == null)
    lblMessage.Text = "context token is null";


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>