5

我之前已经发布并回答了这个问题。WebResource.axd 不适用于 Internet Explorer 11
但我认为修补程序已解决问题(CrossPostback、AJAX 控件和 ASP.NET 生成的回发不起作用)但在 QA 中安装后,它不起作用,我们意识到它是 .NET 4.5 让事情顺利进行。
我正在比较 .NET 4 和 .NET 4.5 之间的 .NET frameworks 文件夹。我需要问的是 .NET 4.5 中什么可以真正解决 IE 11 问题。
IE 11 的主要变化是用户代理字符串。.NET 4.5 中的特定修复可以解决 ASP.NET 4.0 和 IE 11 之间的差异。
如果在 .NET 4.0 中安装了安全/热修复程序,手动合并差异可能不会真正有帮助,这些文件可能会被覆盖。
另一个提示,问题是针对 Windows 7、8、8.1 中的 IE 11 的任何帮助或建议。
更新:我们尝试仅将 .NET 4.5 的浏览器定义注册到 .NET 4.0 中,但问题仍然存在,除了定义之外,还有一些库可以在 IE 11 中运行。

4

2 回答 2

14

We had a similar issue where the auto-postback for a DropDownList stopped working with newer versions of IE. We first noticed it with IE10 and tracked it to the browser definition bug many are aware of and which is detailed here, among other places.

For this particular application, and the set of boxes its different environments ran/runs on, upgrading to 4.5 wasn't a near-term option. What's more, the machine-wide fixes detailed in the post above errored-out when we tried to install it. The site-wide fix, however, did do the trick.

A week or two later, someone happened to hit the site with IE11 Preview, and there the issue was again. We did some more research and discovered that the browser definition "IE10Plus" from the site-wide fix - which did in fact fix the IE10 issue - wouldn't work for IE11. To identify IE10, a majorversion regex match was added - "\d{2,}" - which matched two digits (as opposed to the previous matches which were along the lines of "^9$" - matches exactly "9") and IE10 now worked. The problem is that the IE10Plus definition (and each IE definition before it) derived ultimately from the "IE" definition and that definition also required the UA string to have "MSIE" in it (among other things) and, as of IE11, "MSIE" is no longer part of the UA string.

"IE10Plus" should really be called "IE10".

Given that we couldn't in the near-term upgrade to 4.5, we had to find another solution. And the one we hit on was to create our own IE11 browser definition. We couldn't define any capabilities beyond what we saw in IE10, but that was pretty close and at least it would identify the browser (and not degrade the functionality, as was happening).

People will tell you not to do this, but for some (like us) it does provide a temporary fix until a final solution comes along.

I don't know in what way 4.5 is supposed to fix this. I've looked at the browser definition files and I don't see a way for them to identify IE11 (with no "MSIE" in its UA string), but maybe there is some additional fix buried in a DLL somewhere.

In any case, here's the definition we created and, for us, it solved the problem immediately.

In your project, add to (or create as) App_Browsers/ie.browser, the following:

<!-- Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko -->
<browser id="IE11Preview" parentID="Mozilla">
    <identification>
        <userAgent match="Trident/(?'layoutVersion'\d+).*rv:(?'revision'(?'major'\d+)(\.(?'minor'\d+)?))" />
        <userAgent nonMatch="MSIE" />
    </identification>

    <capabilities>
        <capability name="browser"              value="IE" />
        <capability name="layoutEngine"         value="Trident" />
        <capability name="layoutEngineVersion"  value="${layoutVersion}" />
        <capability name="isColor"              value="true" />
        <capability name="screenBitDepth"       value="8" />
        <capability name="ecmascriptversion"    value="3.0" />
        <capability name="jscriptversion"       value="6.0" />
        <capability name="javascript"           value="true" />
        <capability name="javascriptversion"    value="1.5" />
        <capability name="w3cdomversion"        value="1.0" />
        <capability name="ExchangeOmaSupported" value="true" />
        <capability name="activexcontrols"      value="true" />
        <capability name="backgroundsounds"     value="true" />
        <capability name="cookies"              value="true" />
        <capability name="frames"               value="true" />
        <capability name="javaapplets"          value="true" />
        <capability name="supportsCallback"     value="true" />
        <capability name="supportsFileUpload"   value="true" />
        <capability name="supportsMultilineTextBoxDisplay" value="true" />
        <capability name="supportsMaintainScrollPositionOnPostback" value="true" />
         <capability name="supportsVCard"        value="true" />
        <capability name="supportsXmlHttp"      value="true" />
        <capability name="tables"               value="true" />
        <capability name="supportsAccessKeyAttribute"    value="true" />
        <capability name="tagwriter"            value="System.Web.UI.HtmlTextWriter" />
        <capability name="vbscript"             value="true" />
        <capability name="revmajor"             value="${major}" />
        <capability name="revminor"             value="${minor}" />
    </capabilities>
</browser>

If you're adding to an existing file, look for id="IE10Plus" - you may want to change that to id="IE10" as the "Plus" part is no longer accurate.

As I've said, if you can go to 4.5, and it fixes your issue - great. If you can't, or it doesn't, this might hold you until you can (or until some other fix comes along).

于 2013-10-05T22:46:08.590 回答
1

嗨试试下面的脚本它可能会帮助你。

<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance()._origOnFormActiveElement = Sys.WebForms.PageRequestManager.getInstance()._onFormElementActive;
Sys.WebForms.PageRequestManager.getInstance()._onFormElementActive = function (element, offsetX, offsetY) {
if (element.tagName.toUpperCase() === 'INPUT' && element.type === 'image') {
offsetX = Math.floor(offsetX);
offsetY = Math.floor(offsetY);
}
this._origOnFormActiveElement(element, offsetX, offsetY);
};
</script>
于 2015-01-30T10:30:02.023 回答