【问题标题】:New window receives Server Error in '/' Application新窗口在“/”应用程序中收到服务器错误
【发布时间】:2019-08-02 06:47:27
【问题描述】:

我收到的错误是:

“/”应用程序中的服务器错误。

找不到资源。 说明:HTTP 404。您正在查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请查看以下 URL 并确保其拼写正确。

请求的 URL:/home/WC_public/default.aspx

版本信息:Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.3282.0

如果我在 2012 版本上运行构建/调试,我们目前正在从 Visual Studio 2012 升级到 Visual Studio 2017,一切运行良好且没有错误,但如果我在 2017 中运行它,任何时候我单击链接按钮打开新窗口我得到这个错误

这是被标签命中的代码

<a href="javascript:OpenReports()">Reports</a>

var PDMReports;

函数 OpenReports() {

if (PDMReports == null) {
    PDMReports = window.open(window.location.protocol + "//" + window.location.host + window.location.pathname.substring(0, window.location.pathname.indexOf("/", 1) + 1) + "WC_public/default.aspx", "PDMreports", "resizable=no,location=no,titlebar=yes,menubar=yes,status=no,height=600,width=500");
}
else {
    try {
        PDMReports.location.reload();
        PDMReports.location.hash = "";
    }
    catch (e)
    {
        PDMReports = window.open(window.location.protocol + "//" + window.location.host + window.location.pathname.substring(0, window.location.pathname.indexOf("/", 1) + 1) + "WC_public/default.aspx", "PDMreports", "resizable=no,location=no,titlebar=yes,menubar=yes,height=600,width=500");

    }
}
PDMReports.focus();

}

【问题讨论】:

    标签: javascript asp.net visual-studio visual-studio-2017


    【解决方案1】:

    在这种情况下我能够弄清楚它是

    PDMReports = window.open(window.location.protocol + "//" + window.location.host + window.location.pathname.substring(0, window.location.pathname.indexOf("/", 1) + 1) + "WC_public/default.aspx", "PDMreports", "resizable=no,location=no,titlebar=yes,menubar=yes,status=no,height=600,width=500");
    

    这是vs版本之间的问题,出于某种原因,它不再需要路径名子字符串,只需要WC_public/default.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-12
      • 2013-04-30
      • 1970-01-01
      • 1970-01-01
      • 2017-09-18
      • 2017-07-02
      • 1970-01-01
      相关资源
      最近更新 更多