日期:2014-05-19  浏览次数:20409 次

==模态对话框 页面关闭的问题==
showModalDialog   show一个子窗体,里面有个button按钮
使用response.wirte( " <script> window.close(); </script> ")关闭不了子页面,而是定向到一个新页面。地址好像就是showmodaldialog中传过来的地址
<base   target= "_self "/> 加了也没用。
请问怎么解决?

------解决方案--------------------
应该可以
a.aspx
<input id= "Button1 " type= "button " value= "button " onclick= "window.showModalDialog( "b.aspx "); " />

b.aspx
<head runat= "server ">
<title> b </title>
<base target= "_self "> </base> //一定要加上这一行
</head>
------解决方案--------------------
http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
------解决方案--------------------
因该是js代码某个地方有错误。
<base target= "_self "/> 一定要加,不加就出现你所说的情况。

------解决方案--------------------
添加一个页面
mainframe.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 无标题页 </title>
</head>
<frameset rows= "0,* " frameborder= "NO " border= "0 " framespacing= "0 ">
<frame src= "about:blank " scrolling= "no " noresize>
<frame src= "b.aspx " scrolling= "yes " noresize>
</frameset>
</html>

打开的时候 开这个页面即可
showModalDialog打开的页面需要使用一个框架页面做中间页面才可以.