Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/436.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何将页面重定向到父框架?_C#_Javascript_Internet Explorer_Google Chrome - Fatal编程技术网

C# 如何将页面重定向到父框架?

C# 如何将页面重定向到父框架?,c#,javascript,internet-explorer,google-chrome,C#,Javascript,Internet Explorer,Google Chrome,我正在尝试将页面重定向到父帧。通过使用以下代码 ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('myPage.aspx','_Parent')", true); 但这段代码在谷歌chrome和IE中不起作用,但在Mozila中却能正常工作。 有人能告诉我如何使这段代码独立于浏览器吗 使用以下命令代替window.open: window.location=“[url]” 如果

我正在尝试将页面重定向到父帧。通过使用以下代码

   ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('myPage.aspx','_Parent')", true);
但这段代码在谷歌chrome和IE中不起作用,但在Mozila中却能正常工作。
有人能告诉我如何使这段代码独立于浏览器吗

使用以下命令代替window.open:

window.location=“[url]”

如果希望父窗口显示指定的URL,请使用:


window.parent.location=“[url”]

ScriptManager.RegisterStartupScript(this.Page,this.GetType(),“a”,“parent.window.location.assign('Test.aspx'),true)

你能告诉我怎么用这个吗?我希望这段代码是c#。我认为在第二个代码示例中有一个带有引号的打字错误。