在.net里面的按钮事件里用脚本打开新的页面,在新页面里面添加了<base target="_self">
是这个原因吗,如果不添加的话,如何在该页面进行提交
用了一些window.parent.location.reload();
window.opener.location.reload();
都不起作用

解决方案 »

  1.   

    在关闭之前执行window.opener.location.reload();然后再执行window.close();是可以的呀~~跟<base target="_self">没关系.你再检查一下是不是哪里写错了.
      

  2.   

    private void Button1_Click(object sender, System.EventArgs e)
    {
    string strScript="\n";
    strScript += "<script>\n";
    //strScript += "window.opener.document.returnValue='" + this.RadioButtonList1.SelectedItem.Text.Replace("'", "\'") + "'\n";
    //strScript +="window.opener.document.forms[0]."+control.Value+".value='" + this.RadioButtonList1.SelectedItem.Text+ "'\n";
    strScript +="window.parent.location.reload();\n";//不起作用
    //strScript +="window.parent.close();\n";//不起作用
    strScript +="document.close();\n";
     strScript += "window.close()\n";
    strScript += "</script>\n";if (!IsClientScriptBlockRegistered("clientScript"))
    RegisterClientScriptBlock("clientScript", strScript);
    }
    这是我的代码,不知道是哪里出了问题
      

  3.   

    只要加上这句话就可以了。
    Response.Write("<script>window.opener.location='UserList.aspx'</script>");
    其中'UserList.aspx'是你打开它的页面。
      

  4.   

    window.parent.location.reload(true);好像要这样, 我忘记了。我记得如果不写true的话。 是从IE的缓存刷新默认是falseture的话。 是从server刷新
      

  5.   

    Liu_Qiang(人为财死,鸟为食亡)
    用这种方法可以重新打开一个,但是想刷新啊,我的用window.opener 总是出错,用window.parent就可以
    因为保存了session值,所以重新打开窗口的话会出错