Sharepoint 2013 如何从sharepoint提供商托管的应用程序更改主机web url

Sharepoint 2013 如何从sharepoint提供商托管的应用程序更改主机web url,sharepoint-2013,sharepoint-apps,Sharepoint 2013,Sharepoint Apps,我想从提供商托管的应用程序更改主机web的url。 基本上,在我的提供商托管应用程序中完成某些业务逻辑后,我希望导航到SharePoint portal的另一个页面(例如搜索中心页面) 当我执行“response.redirect”或“window.location.href”时,它正在应用程序iframe中加载。我想在主窗口中加载相同的页面 请建议 使用我的逻辑更新 我有一个获取列表主页url的通用方法 public string ListHomePage(ClientContext clie

我想从提供商托管的应用程序更改主机web的url。 基本上,在我的提供商托管应用程序中完成某些业务逻辑后,我希望导航到SharePoint portal的另一个页面(例如搜索中心页面)

当我执行“response.redirect”或“window.location.href”时,它正在应用程序iframe中加载。我想在主窗口中加载相同的页面

请建议

使用我的逻辑更新 我有一个获取列表主页url的通用方法

public string ListHomePage(ClientContext clientContext, string listName)
        {

            Web spWeb = clientContext.Web;
            clientContext.Load(spWeb, web => web.Url);
            clientContext.ExecuteQuery();

            return TokenHelper.GetAppContextTokenRequestUrl(spWeb.Url, HttpContext.Current.Server.UrlEncode(spWeb.Url + "/Lists/" + listName));
        }
我在应用程序页面中调用以下代码

Response.Redirect(ListHomePage(clientContext1, "Test ListName"));

当AppPart在iframe中加载时,可以使用以下代码实现同样的效果

    string redirectUrl = ListHomePage(clientContext1, "Test ListName");
    string script = "<script type='text/javascript'>window.parent.location.href = '" + redirectUrl + "'; </script>";
    //Here I am using Telerik ScriptManager to execute script
    RadScriptManager.RegisterStartupScript(this, this.GetType(), "Load", script, false);
string redirectUrl=ListHomePage(clientContext1,“testlistname”);
string script=“window.parent.location.href=”+重定向URL+“;”;
//这里我使用Telerik ScriptManager来执行脚本
RadScriptManager.RegisterStartupScript(this,this.GetType(),“Load”,script,false);

到目前为止您尝试了什么(添加代码)?请阅读Devjal,请检查更新的问题。。谢谢