弹出新窗口,填写数据,提交后,关闭该弹出窗口,刷新父页面
类别: JavaScript教程
父窗口弹出子窗口的 button处理事件:
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("<script language=javascript>window.open('WebForm1.aspx','', 'alwaysRaised=1,dependent=1,resizable=0,scrollbars,width=450,height=550');</script>");
}
父窗口html代码添加如下javascript代码
<script language="javascript">
function refresh()
{
this.location = this.location;
}
</script>
子窗口关闭窗口的 button处理事件:
private void Button1_Click(object sender, System.EventArgs e)
{
StringBuilder scriptString = new StringBuilder();
scriptString.Append("<script language = javascript>");
scriptString.Append("window.opener.refresh();");
scriptString.Append( " window.focus();" );
scriptString.Append( " window.opener=null;" );
scriptString.Append( " window.close(); " );
scriptString.Append("</"+"script>");
Response.Write(scriptString.ToString());
// Response.Write("<script language=javascript>window.close()</script>");
}
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("<script language=javascript>window.open('WebForm1.aspx','', 'alwaysRaised=1,dependent=1,resizable=0,scrollbars,width=450,height=550');</script>");
}
父窗口html代码添加如下javascript代码
<script language="javascript">
function refresh()
{
this.location = this.location;
}
</script>
子窗口关闭窗口的 button处理事件:
private void Button1_Click(object sender, System.EventArgs e)
{
StringBuilder scriptString = new StringBuilder();
scriptString.Append("<script language = javascript>");
scriptString.Append("window.opener.refresh();");
scriptString.Append( " window.focus();" );
scriptString.Append( " window.opener=null;" );
scriptString.Append( " window.close(); " );
scriptString.Append("</"+"script>");
Response.Write(scriptString.ToString());
// Response.Write("<script language=javascript>window.close()</script>");
}
- 上一篇: 无限分类算法 js 的实现
- 下一篇: Javascript控制XSlt转换XML
-= 资 源 教 程 =-
文 章 搜 索