Redirect in SharePoint provider hosted Add Ins

If you are using an asp:hyperlink to another page in your provider hosted app you will see the SharePointContextProvider will not be able to handle the redirect.
To fix the problem you need to add a click event and call a redirect in your code behind.


The redirect should look like this:

1
Response.Redirect(Page.Request.Url.OriginalString.Replace("ThePageWhereYouAre.aspx", "ThePageYouWantToGoTo.aspx"));

This way all parameters in the URL are the same as they were before.

Comments

Popular posts from this blog

Refresh the User Information List in SharePoint

Get the mail address from a FieldUserValue Client Side vs Server Side