关于网友提出的“ windowshowModalDialog刷新父窗口问题”问题疑问,本网通过在网上对“ windowshowModalDialog刷新父窗口问题”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: windowshowModalDialog刷新父窗口问题
描述: 父页面代码
//写在pageload里
int i = 1;
if (i == 1)
{
ClientScript.RegisterStartupScript(this.GetType(), "open", "
模态框弹出的页面代码(子窗口):
protected void Page_Load(object sender, EventArgs e)
{
string userName = Request.QueryString["UserName"].ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "open", "
现在想知道如何让我点击完子窗口的按钮之后再触发父页面的这段代码:
if (hid.Value == "1")
{
Response.Write("b.aspx");
}
有没有看明白我的需求?
解决方案1: if (hid.Value == "1")
{
Response.Write("b.aspx");
}
你要在服务器执行?js是客户端的,要在服务器执行,你需要先把结果提交
解决方案2: 关闭 子窗体时,加上parent.hid.value=1;parent.window.loction.reload();
就是 设置父窗体的 hid 控件值,刷新父窗体
ClientScript.RegisterStartupScript(this.GetType(), "open", "
以上介绍了“ windowshowModalDialog刷新父窗口问题”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2369329.html