服务器控件怎么实现window.showModalDialog弹出页面关闭时刷新父页面
index.aspx页面
protected void Button1_Click1(object sender, EventArgs e)
{
this.Response.Write("<script language='javascript'>window.showModalDialog('Edit.aspx','window','dialogWidth:800px;dialogHeight:600px');</script>");
} 这样弹出
但在子页面 Edit.aspx
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();</script>"); 关闭怎么刷新父页面
}
//openDlg假设是你要打开的模式窗体.需要在打开的窗体中关闭的时候设置DialogResult==DialogResult.OK
if (openDlg.ShowDialog() == DialogResult.OK)
{
//刷新
}
index.aspx页面
protected void Button1_Click1(object sender, EventArgs e)
{
this.Response.Write("<script language='javascript'>window.showModalDialog('Edit.aspx','window','dialogWidth:800px;dialogHeight:600px');</script>");
} 这样弹出
但在子页面 Edit.aspx
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();</script>"); 关闭怎么刷新父页面
}
@爱在-&-风雨: index.aspx页面的加上一点点,如下:
this.Response.Write("<script language='javascript'>window.showModalDialog('http://baidu.com','window','dialogWidth:800px;dialogHeight:600px');window.location.href=window.location.href ;</script>");
@LCM: 谢谢你问题自己已经解决 要用客户端的方法就ok
上面的父窗体的代码,子窗体的代码是:this.DialogResult = DialogResult.OK;
index.aspx页面
protected void Button1_Click1(object sender, EventArgs e)
{
this.Response.Write("<script language='javascript'>window.showModalDialog('Edit.aspx','window','dialogWidth:800px;dialogHeight:600px');</script>");
} 这样弹出
但在子页面 Edit.aspx
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();</script>"); 关闭怎么刷新父页面
}
@爱在-&-风雨: document.location.href='SupplierProductManage.aspx?Guid=
@痛苦造就性格: 谢谢你问题已经解决 用客户端方法就ok
function openwind() {
var k = window.showModalDialog("Edit.aspx", window, "dialogWidth:800px;dialogHeight:600px");
if (k != null) {
document.getElementById("Text1").value = k;
}
}