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

为何用showModalDialog打开对话框后,在对话框中提交页面会打开新的页面?
打开对话框的脚本如下:
function   ChangePassword(ID)
{
window.showModalDialog( 'SetUserPassWord.aspx?ID= '+   ID, ' ',   'dialogWidth:280px;dialogHeight:300px;center:yes;resizable:no;help:no;resizable:no;status:no;scrollbar:no '   );
}


------解决方案--------------------
openwindow
------解决方案--------------------
在记得是要加 target=_self
------解决方案--------------------
用框架可以实现,
------解决方案--------------------
function ChangePassword(ID)
{
window.showModalDialog( 'SetUserPassWordFrm.aspx?ID= '+ ID, ' ', 'dialogWidth:280px;dialogHeight:300px;center:yes;resizable:no;help:no;resizable:no;status:no;scrollbar:no ' );
}
这个需要你打开的窗口 必须被包含在一个框架内(SetUserPassWordFrm.aspx)
<html>
<head>
<title> 无标题页 </title>
</head>
<frameset rows= "0,* " frameborder= "NO " border= "0 " framespacing= "0 ">
<frame src= "about:blank " scrolling= "no " noresize>
<frame src= "SetUserPassWord.aspx?ID= <%=m_CID %> " scrolling= "yes " noresize>
</frameset>
</html>
m_CID 在.cs中定义
protected string m_CID = string.Empty;
Page_Load中
m_CID = Request[ "ID "];
------解决方案--------------------
<head base target= "_self "> </head>