关闭子窗口,刷新父页面
父窗口代码:protectedvoidgvReader_RowEditing(objectsender,GridViewEditEventArgse){stringid=...
父窗口代码:
protected void gvReader_RowEditing(object sender, GridViewEditEventArgs e)
{
string id = gvReader.Rows[e.NewEditIndex].Cells[0].Text;
Response.Write("<script language='javascript'>window.showModalDialog('ReaderEdit.aspx?id=" + id + "','window','DialogHeight:480px;DialogWidth:900px;scroll:no;status:no');</script>");
}
子窗口代码:
protected void imgbtnOK_Click(object sender, ImageClickEventArgs e)
{
UpdateText();
Response.Write("<script>window.alert('修改成功!')</script>");
Response.Write("<script language=javascript>window.close();</script>");
}
如何实现关闭子窗口后,自动刷新父窗口的数据
父窗口的名字为:ReaderBrowing.aspx
子窗口的名字为:'ReaderEdit.aspx
UpdateText();为更新数据函数 展开
protected void gvReader_RowEditing(object sender, GridViewEditEventArgs e)
{
string id = gvReader.Rows[e.NewEditIndex].Cells[0].Text;
Response.Write("<script language='javascript'>window.showModalDialog('ReaderEdit.aspx?id=" + id + "','window','DialogHeight:480px;DialogWidth:900px;scroll:no;status:no');</script>");
}
子窗口代码:
protected void imgbtnOK_Click(object sender, ImageClickEventArgs e)
{
UpdateText();
Response.Write("<script>window.alert('修改成功!')</script>");
Response.Write("<script language=javascript>window.close();</script>");
}
如何实现关闭子窗口后,自动刷新父窗口的数据
父窗口的名字为:ReaderBrowing.aspx
子窗口的名字为:'ReaderEdit.aspx
UpdateText();为更新数据函数 展开
2个回答
展开全部
protected void gvReader_RowEditing(object sender, GridViewEditEventArgs e)
{
string id = gvReader.Rows[e.NewEditIndex].Cells[0].Text;
Response.Write("<script language='javascript'>window.showModalDialog('ReaderEdit.aspx?id=" + id + "','window','DialogHeight:480px;DialogWidth:900px;scroll:no;status:no');window.location=window.location;</script>");
}
这样可以刷新的。
如果你加一个按钮ID=btnHid,把按钮的宽和高设置成0,该按钮的点击事件和你页面中查询按钮事件写成一样的。那样的话。你把上面的window.location=window.location替换成document.getElementById("btnHid").click()也可以实现子窗口关闭,父窗口刷新的
{
string id = gvReader.Rows[e.NewEditIndex].Cells[0].Text;
Response.Write("<script language='javascript'>window.showModalDialog('ReaderEdit.aspx?id=" + id + "','window','DialogHeight:480px;DialogWidth:900px;scroll:no;status:no');window.location=window.location;</script>");
}
这样可以刷新的。
如果你加一个按钮ID=btnHid,把按钮的宽和高设置成0,该按钮的点击事件和你页面中查询按钮事件写成一样的。那样的话。你把上面的window.location=window.location替换成document.getElementById("btnHid").click()也可以实现子窗口关闭,父窗口刷新的
展开全部
父窗口代码:
protected void gvReader_RowEditing(object sender, GridViewEditEventArgs e)
{
string id = gvReader.Rows[e.NewEditIndex].Cells[0].Text;
Response.Write("<script language='javascript'>window.showModalDialog('ReaderEdit.aspx?id=" + id + "',window,'DialogHeight:480px;DialogWidth:900px;scroll:no;status:no');</script>");
}
子窗口代码:
protected void imgbtnOK_Click(object sender, ImageClickEventArgs e)
{
UpdateText();
Response.Write("<script>window.alert('修改成功!')</script>");
Response.Write(@"<script language=javascript>
window.dialogArguments.location.href = window.dialogArguments.location.href;
window.close();</script>");
}
protected void gvReader_RowEditing(object sender, GridViewEditEventArgs e)
{
string id = gvReader.Rows[e.NewEditIndex].Cells[0].Text;
Response.Write("<script language='javascript'>window.showModalDialog('ReaderEdit.aspx?id=" + id + "',window,'DialogHeight:480px;DialogWidth:900px;scroll:no;status:no');</script>");
}
子窗口代码:
protected void imgbtnOK_Click(object sender, ImageClickEventArgs e)
{
UpdateText();
Response.Write("<script>window.alert('修改成功!')</script>");
Response.Write(@"<script language=javascript>
window.dialogArguments.location.href = window.dialogArguments.location.href;
window.close();</script>");
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询