Sharepoint 2013 app navigate to Site Page
We have created a provider hosted app with few pages in it.Each page in the app has an exit button on it. This app is added on SharePoint pages as app part with different pages showing on each page.

Requirement is to navigate to site home page on Exit click.
I have thought of following :

 1. Navigating in app code will only navigate in the iframe.
 2. content editor js will not be able to access the elements in iFrame.

Please suggest what options i have.
April 20th, 2015 10:19am

Hi Mohit,

From your description, my understanding is that you want to redirect to SharePoint site from provider hosted app.

As you mentioned in your description, provider hosted app is in an iframe, if you want to redirect to SharePoint site, the app need to redirect the parent page from iframe. Please refer to this code below:

function exitClick(){
//replace your home page URL
window.parent.location.href="https://milesli.sharepoint.com/sites/DevSite";
}

<input type="button" value="exit" onclick="exitClick()"/>

Here are some articles about redirecting the parent page from iframe:

Redirect parent window from an iframe action

http://stackoverflow.com/questions/580669/redirect-parent-window-from-an-iframe-action

Redirect the parent page from Iframe

http://stackoverflow.com/questions/2092275/redirect-the-parent-page-from-iframe

Best Regards,

Vincent Han

Free Windows Admin Tool Kit Click here and download it now
April 21st, 2015 10:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics