showModalDialog后在C#中怎么关闭

unling 2009-04-26 10:31:46
父页面按钮点击后打开showModalDialog
function showCommonDialogWithParams(obj)
{

var features = "dialogHeight:450px;scroll:no;help:no;status:no;resizable:yes; dialogWidth:700px;";
if(obj.children.length>1)
{
showModalDialog("Edit.aspx?id="+obj.children[1].value, null, features);
}

}
到了Edit.aspx页面, 页面上有个button 点击后到Edit.aspx.cs中去保存数到据数据库,
保存成功后我要关闭这个showModalDialog 我写的方法是
Page.ClientScript.RegisterStartupScript(this.GetType(), "g1", "<script >window.close()script>");
但是却打开了个新页面一闪就把它关闭,而Edit.aspx却依然存在的。
我的想法是"<script >window.close()script>");打开了个新页面并写进去这个脚本 所以有我说的“但是却打开了个新页面一闪就把它关闭“现象
请问在C#中怎么关闭showModalDialog打开的模式窗口?
...全文
104 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
unling 2009-04-26
  • 打赏
  • 举报
回复
谢谢两位成功解决
快40的码农 2009-04-26
  • 打赏
  • 举报
回复
在你的Edit.aspx页面的heard中加上
<base target="_self" />
就可以了
满衣兄 2009-04-26
  • 打赏
  • 举报
回复
<html>

<head>

<title>test</title>

<base target="_self"/>

.............

</head>

</html>

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧