打开页面新选项卡并刷新当前页面

时间:2014-03-13 06:05:52

标签: c# javascript asp.net

Page.ClientScript.RegisterStartupScript(Page.GetType(), null, "window.open('bill_reciept.aspx?Parameter=" + txt_billNo.Text + "', '_newtab')", true); 

这是标签

中的新页面
Page.ClientScript.RegisterStartupScript(Page.GetType(), null, "window.open('customerReg.aspx', '_self')", true);

想要刷新的旧页面

新标题页已在标签页中打开,但旧页面无法刷新或在同一标签页的新页面中打开

2 个答案:

答案 0 :(得分:2)

试试这个:

您可以使用以下代码在同一页面上重定向:

Response.Redirect(Request.RawUrl);    

如果您想在客户端而不是服务器上执行,请使用

 javascript:document.location.reload() 

window.location.href= window.location; 

我已经提到了以下链接,你也可以这样做:

http://forums.asp.net/t/1310604.aspx?+How+to+refresh+the+page+programatically+by+C+

答案 1 :(得分:1)

执行以下操作......

调用下面的javascript方法......

var windowObjectReference;

function openRequestedPopup() {
    windowObjectReference = window.open("CMS_1.aspx",
          "DescriptiveWindowName",
          "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
}

这将在新标签页中打开页面,在功能结束时你必须重新加载位置....

相关问题