互联网浏览器11给出PageRequestManager.js脚本错误互联网、脚本、浏览器、错误

2023-09-03 13:27:47 作者:心若沉浮丿浅笑安然

我使用ASP.NET 4.5服务器上,我有一个.NET Windows应用程序与Web浏览器控件导航到该网页的服务器上。

I'm using ASP.NET 4.5 on the server and I have a .NET Windows application with a Web Browser control that navigates to the web page on the server.

如果我的系统上运行Windows应用程序与Internet Explorer 11,我得到一个脚本错误:导航到另一个页面时,对象不支持属性或方法的attachEvent'。该脚本文件的ScriptResource.axd所以它不是任何我的脚本。

If I run the Windows application on a system with Internet Explorer 11, I get a script error: "Object doesn't support property or method 'attachEvent'" when navigating to another page. The script file is ScriptResource.axd so it isn't any of my scripts.

我不知道的Internet Explorer 11不支持的attachEvent了(更换attachEventListener?)。这不过是没有多大帮助这里,因为JavaScript是框架的一部分,而不是在我的code。

I do know that Internet Explorer 11 doesn't support attachEvent anymore (replaced with attachEventListener?). That is however not of much help here, as the javascript is part of the framework, not in my code.

我找到的JavaScript源在此框架: http://ajaxcontroltoolkit.$c$cplex.com/SourceControl/latest#Client/MicrosoftAjax/Extensions/Sys/WebForms/PageRequestManager.js

I found the javascript source for the framework here: http://ajaxcontroltoolkit.codeplex.com/SourceControl/latest#Client/MicrosoftAjax/Extensions/Sys/WebForms/PageRequestManager.js

// DevDiv Bugs 100201: IE does not set referrer header on redirect if you set window.location, inject anchor node instead
// dynamic anchor technique only works on IE
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
    var anchor = document.createElement("a");
    anchor.style.display = 'none';
    // cancel bubble so body.onclick is not raised
     anchor.attachEvent("onclick", cancelBubble);
    // more code...
}

这是Sys.Webforms.PageRequestManager模块的核心ASP.NET框架的一部分,据我了解。

This is the Sys.Webforms.PageRequestManager module that is part of the core ASP.NET framework as far as I understand.

执行该行的attachEvent 提供在Internet Explorer 11脚本错误,但在旧版本的Internet Explorer的伟大工程。

The line that performs attachEvent gives script error on Internet Explorer 11, but works great on older versions of Internet Explorer.

如何解决这个问题呢?是否有任何已知的解决方法?我不能罚款任何更新本。

How to fix this problem? Are there any known workarounds? I couldn't fine any updates for this.

推荐答案

尝试强制浏览器IE中的10人模式来呈现......

Try forcing the browser to render in IE 10 mode...

<meta http-equiv="X-UA-Compatible" content="IE=10" />