0

在加载 Access.aspx 时,会调用一个 javascript 函数。

<head>
<title>access</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<link href="rtsBanner.css" type="text/css" rel="stylesheet">

<script language="JavaScript" type="text/javascript" src="winopen.js"> </script>

<script type="text/javascript" language="javascript">
    function openLogin(site, pass) {
        var loginUrl = 'login.aspx';
        if (site != '' && pass != '') {
            loginUrl += '?SITE=' + site + '&PASS=' + pass;
        }
        else if (site != '') {
            loginUrl += '?SITE=' + site;
        }
        var popUpFeatures = 'dialogHeight: 385px; dialogWidth: 600px; edge: Raised; center: Yes; help: No; resizable: No; scroll: Yes; status: No;';
        var RetVal = window.showModalDialog(loginUrl, 'null', popUpFeatures);
        if (typeof (RetVal) == 'undefined') {
            top.window.close();
        }
        else {
            var RetArray = RetVal.split(',')
            var ValidLogon = RetArray[0];
            var MUName = RetArray[1];
            if (ValidLogon == 1) {
                document.location.href = 'newRequest.aspx?desc=' + MUName;
            }
            else {
                top.window.close();
            }
        } // else(typeof(RetVal)
    }
</script>

</head>
<body ms_positioning="GridLayout" onload="openLogin('<%=Request("SITE")%>','<%=Request("PASS")%>');">
<form id="Form1" method="post" runat="server">
&nbsp;
</form>
</body>
</html>

此代码在 IE 中完美运行,但在我输入站点名称和密码并点击登录按钮后,在登录屏幕上的 safari 中,它不会将我重定向到 newRequest.aspx 页面,而只是关闭登录弹出窗口并显示一个空白的 access.aspx 页面.

编辑:

这是 btnLogin_Click 上 Login.aspx.vb 页面上的代码

If txtSiteName.Text = "" And txtPassPhrase.Text = "" Then Return
        If ValidateSiteAndPass(txtSiteName.Text, txtPassPhrase.Text) = False Then
            Throw New Exception("OOPS!!! Either SiteName or Pass Phrase is Invalid, please check")
        Else
            Session("valid") = "true"
            Response.Write("<script language='javascript'>{window.returnValue='1," + txtSiteName.Text + "'; self.close();}</script>") '''document.Form1.submit();")
            Response.End()
        End If

请建议

谢谢,卡维塔

4

1 回答 1

0

我在这里找到了解决方案。

http://forums.asp.net/t/1400811.aspx/1

问题是由于window.showModalDialog。它在 Safari 中无法正常工作。我将其替换为 window.open

谢谢,卡维塔

于 2012-11-06T10:21:11.623 回答