照你的描述, 应该是你的login.aspx 里面出了脚本错误的原因用 showModalDialog 的方式弹出窗口很不好调试, 你在 login.aspx 的 function window.onload()里加一个alert();看看就知道了看会不会弹出窗口, 会的话说明已经执行到login.aspx了我以前测试时也常遇到这种错误, 最好是直接用ie打开login.aspx,在window.onload事件里给它一些模拟的参数进行调试
调试欢乐多
2.模态窗口的关闭
3.模态窗口的传递参数。
4.其他。
1.window.showModalDialog("DialogPage.aspx","newwin","dialogHeight: 200px; dialogWidth: 150px; dialogTop: 458px; dialogLeft: 166px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;");2.window.close();3.传值
ParentPage.aspx:
window.showModalDialog("DialogPage.aspx?para1=aaa¶2=bbb");DialogPage.aspx:
string str1=Request.QueryString["para1"].toString();
string str2=Request.QueryString["para2"].toString();返回值
DialogPage.aspx:
window.returnValue="aaa";ParentPage.aspx:
var str=window.showModalDialog("DialogPage.aspx");4.
aspx页面在showmodeldialog情况下为什么一提交就重新打开一个页面?
showmodaldialog打开的页面中在<head></head>之间加入一行:<base target="_self">
就是自己调用自己的window.showModalDialog("login.aspx",window,sFeatures);
Response.Write("***")其中***为你的window.showModalDialog("login.aspx",window,sFeatures);
Page.RegisterClientScriptBlock("myscript", strScript);
意味着:能进LOGIN。ASPX。
function startLogin(){
var current=window.top;
if (current.opener!=null){
current.opener.location="Login.aspx";
current.close();
}
else{
/*while (current.opener!=null){
var parentWindow=current.opener;
current.close();
current=parentWindow.top;
}*/
var nDialogWidth=348;
var nDialogHeight=420;
var nLeft=(window.screen.availWidth-nDialogWidth)/2;
var nTop=(window.screen.availHeight-nDialogHeight)/2;
window.moveTo(-9999,-9999);//窗口最小化
var sFeatures="dialogLeft:"+nLeft+"px;dialogTop:"+nTop+"px;dialogHeight:"+nDialogHeight+"px;dialogWidth:"+nDialogWidth+"px;help:no;status:no";
var bLogged=window.showModalDialog("login.aspx","",sFeatures);
if (bLogged){
window.moveTo(0,0);//窗口还原
window.top.location="Default.htm";
}
else{
window.moveTo(0,0);
window.top.location="Default.htm"
//HHCTRL.Click();//HTML HELP控件实现无提示关闭窗口*/
window.close();
}
}
}function help()
{
window.showHelp("loginhelp.htm")
}
function pwdsetfocus()
{
frm.txtloginid.focus()
}
//--></SCRIPT>.................
<form id="form">
<script language="javascript">
//调用
startLogin();
</script>
</FORM>
实现类似C/S模式下 弹出登录窗口的功能
就是自己调用自己的window.showModalDialog("login.aspx",window,sFeatures);