这个问题的解决方案有不少,但有些方法总会出问题,下面提一个终极解决办法做参考
思路:在父页面提交一个LinkButton按钮,让其隐藏,关闭子页面的时候让LinkButton onclick事件重新刷新页面。
首先在父页面添加一个LinkButton让其text为空,那么就可以隐藏LinkButton,然后注册这个按钮的js,LinkButton.Attributes.Add("onfocus", "javascript:__doPostBack('btnFresh','');");
添加一段JS代码
var sReturn=window.showModalDialog("" + id,'','dialogWidth:420px;dialogHeight:570px,center=yes,status=no,resizable=no,scroll=no,dialogHide=on');;
if (typeof(sReturn) != "undefined")
{
if (sReturn=="1")
{
document.all["btnFresh"].focus();
}
}
然后在子页面提价一下JS代码
function reload()
{
window.parent.returnValue='1';window.close();
}
因为是showModalDialog 所以记住加入 <base target="_self"/>
0
0
[Yii Framework] yii 如何使用第三方插件
[PHP] Header to out put the image file.
[PHP] PHP 格式化日期 format the datetime in PHP
VC6工程中的文件类型
VC6++ output :error executing c:\windows\system32\cmd.exe.
根据选择计算Mask值
.NET垃圾收集关键方法解析(转)
JS访问表格的每行的每个TD的方法
HTTP 状态消息详解
- 最新文章
-
js/jquery操作cookie[原+转]
C#正则匹配、分组和替换
Json对象格式化字符串输出[转]
jQuery ajax queue
asp.net ajax异常处理
一些php技巧
GetCurrentDirectory和StartupPath
Invalid temp directory in chart handler configuration [c:\TempImageFiles\]
自制jQuery智能提示插件一枚
[PHP] To display some attribute of the node in the XML document.
- 热门文章
-
[Yii Framework] CWidget::init()与CWidget::run()的区别
[eZ publish] how to test the variables that exist in the url
[eZ publish] Template function: sequence
[PHP] concatenation operator and addition operator
[Ubuntu] vim的redo是怎么按的?
[eZ publish] fetch_alias() and fetch()
[Yii Framework] CJuiDialog如何定义按钮
[Ubuntu] 添加lampp为自启动程序 Add the lampp as the server
[Yii Framework] 如何获取当前controller的名称?
[Ubuntu] 生成文档的MD5校验码
Copyright © 2011-2022 走看看