反应datagrid里修改后的内容。
当然是用window.opener.location.reload()来实现。
不过会弹出一窗口,点击“重试”按钮,才实现返回并刷新。
在论坛查了一下,有几个办法:
一是把form的method改为get,倒是可以实现,
不过我的主页面里有dropdownlist,并实现autopostback,
改为get后,改变该dropdownlist事件,有时会报错:
执行到function _dopostPack()函数里的theform.submit();时,
报htmlfile 无效错误。
二是window.opener.loaction = window.opener.location.href
页面是刷新了,但页面回到的是初始状态。
三是window.opener.form名字.submit(),
“重试窗口没有出现,但也没有刷新,:(
敢问有什么好的解决办法,HELP ME !!!
4 个解决方案
#1
我们是这样的
update.aspx update_button()
{
...
Response.write("<script javascript...
window.opener.refresh();window.opener=null;window.close()</script>");
}
main.aspx
<javascript..
function refresh()
{
_doPostBack("refresh_click","");
}
have a server button of id='refresh',it is not visible
in main.aspx.cs
refresh_click(...)
{
do what you want do
}
update.aspx update_button()
{
...
Response.write("<script javascript...
window.opener.refresh();window.opener=null;window.close()</script>");
}
main.aspx
<javascript..
function refresh()
{
_doPostBack("refresh_click","");
}
have a server button of id='refresh',it is not visible
in main.aspx.cs
refresh_click(...)
{
do what you want do
}
#2
to 2002pine,
我备份的数据库没有拷回家,只有明天试了,先谢谢了。
我备份的数据库没有拷回家,只有明天试了,先谢谢了。
#3
子页面Response.Redirect(主页面)
#4
window.opener.document.form名字.submit();
should work, or use a hidden button and call its click() method
main.aspx:
<form runat="server" id="form1">
.....
<asp:Button id="btn" runat="server" style="display:none" />
</form>
child.aspx:
window.opener.document.form1.submit();
or
window.opener.document.all("btn1").click();
should work, or use a hidden button and call its click() method
main.aspx:
<form runat="server" id="form1">
.....
<asp:Button id="btn" runat="server" style="display:none" />
</form>
child.aspx:
window.opener.document.form1.submit();
or
window.opener.document.all("btn1").click();
#1
我们是这样的
update.aspx update_button()
{
...
Response.write("<script javascript...
window.opener.refresh();window.opener=null;window.close()</script>");
}
main.aspx
<javascript..
function refresh()
{
_doPostBack("refresh_click","");
}
have a server button of id='refresh',it is not visible
in main.aspx.cs
refresh_click(...)
{
do what you want do
}
update.aspx update_button()
{
...
Response.write("<script javascript...
window.opener.refresh();window.opener=null;window.close()</script>");
}
main.aspx
<javascript..
function refresh()
{
_doPostBack("refresh_click","");
}
have a server button of id='refresh',it is not visible
in main.aspx.cs
refresh_click(...)
{
do what you want do
}
#2
to 2002pine,
我备份的数据库没有拷回家,只有明天试了,先谢谢了。
我备份的数据库没有拷回家,只有明天试了,先谢谢了。
#3
子页面Response.Redirect(主页面)
#4
window.opener.document.form名字.submit();
should work, or use a hidden button and call its click() method
main.aspx:
<form runat="server" id="form1">
.....
<asp:Button id="btn" runat="server" style="display:none" />
</form>
child.aspx:
window.opener.document.form1.submit();
or
window.opener.document.all("btn1").click();
should work, or use a hidden button and call its click() method
main.aspx:
<form runat="server" id="form1">
.....
<asp:Button id="btn" runat="server" style="display:none" />
</form>
child.aspx:
window.opener.document.form1.submit();
or
window.opener.document.all("btn1").click();