父页面有一Datagrid
弹出页面设置完成后 ,让父页面的Datagrid帮定!
弹出页面设置完成后 ,让父页面的Datagrid帮定!
解决方案 »
- 我的上传图片并生成缩略图代码为什么不能在虚拟主机上运行了
- 我不想用gridview控件,想自定义表格输出,请问怎么办???
- word操作问题
- 关于一个JS脚本的简单问题???
- 数据库中显示NULL 为什么用row["name"]==null判断不出来呢?
- 怎么在WEB程序里知道要访问的文件
- 关于datagrid中的selectedIndexchanged事件的触发问题(分不够可以加)
- 不知道是不是安装问题。
- 为何VS2008专业版本开发ASP.NET程序时不能从工具箱里拖拽服务器控件到设计页面(HTML控件能拖拽)
- 这问题可不小,不回答可惜了!
- 如何在js里取得FCKeditor.Net的内容?
- Request.Cookies判断空为的问题
/// 关闭当前窗口并刷新父窗口
/// </summary>
public static void CloseWindow()
{
string js=@"<Script language='JavaScript'>
window.close();
window.opener.location.href=window.opener.location.href;
</Script>";
HttpContext.Current.Response.Write(js);
HttpContext.Current.Response.End();
}
把以上函数在你的Button事件里调用就可以啦
当单击Button的时候就会调用这段脚本!!!
<script language = javascript>
function recieve(value)
{
var reciever = document.getElementById('txtName');
reciever.value = value;
}
</script>
在B页面中,被选中后出发该事件
<script language=javascript>
function ShowWin()
{
if(this.opener != null)
{
if(this.opener.recieve)
{
this.opener.recieve('被选的值');
this.opener = null;
window.close();
}
else
alert('父窗口必须定义recieve(value)方法以接收返回值');
}
else
alert('父窗口错误');
}
</script>
{
if (window.dialogArguments != null)
var w = window.dialogArguments;
//w.location.reload();
w.location.href = "*.aspx";
window.close();
}