【发布时间】:2014-10-21 11:58:08
【问题描述】:
我有弹出窗口,点击哪个新弹出窗口打开,然后当用户填写数据时,它会重定向到也在弹出窗口中打开的页面。我希望该页面在新标签页中打开,并且弹出窗口应该关闭。
请帮助如何使用背后的 asp.net 代码实现这一点 查看我的代码以了解我的尝试,
protected void btnSend_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "window.open('dummy.aspx')", "\", \"\");", true); // tried with both, but not working
Response.Redirect("dummy.aspx");
}
无法使用 onClientClick,因为我在按钮单击时还有其他几个验证
【问题讨论】:
-
"I have popup, on click of which new popup opens and then when user fills the data, it redirects to page which also opens in a popup"- 哇哦。 -
“请帮助如何实现这一点” - 我的建议是“不要” - 一个弹出窗口不好,多个弹出窗口是一场噩梦。
-
@David:实际上,我有两个一个接一个的弹出窗口。!
-
我希望在第二个弹出窗口中有一个按钮。单击它,将打开一个页面。我希望该页面在新选项卡中打开,并且我单击提交按钮的表单也应该刷新。
-
您可以像 JQuery 一样执行客户端脚本,而不是在服务器端进行脚本处理。