Javascript重定向适用于Chrome但不适用于IE

时间:2014-06-09 17:46:17

标签: c# javascript asp.net

以下JavaScript脚本注册表在chrome中运行时没有任何问题。与IE一起使用时,网址缺少/

例如,使用Chrome我正确登陆//Sever-Name/Submit.aspx 在IE中我登陆//Sever-NameSubmit.aspx

有没有人有解决此问题的建议

ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
"alert('Your request Was submitted successfully. You will be redirected to the confirmation page.');
window.location='" + Request.ApplicationPath + "Submit.aspx';", true);

1 个答案:

答案 0 :(得分:0)

不应该是:

window.location='" + "/" + Request.ApplicationPath + "/" + "Submit.aspx';", true);

此外,在JavaScript中," /"用作转义字符。您可能还必须逃离逃避字符:var link = "site.com//myPage.aspx"

相关问题