带有 IE11 的 ASP.NET WebForms 4.0 站点不会为 Windows

ASP.NET WebForms 4.0 Site with IE11 does not load ScriptResource for PageRequestManager on Windows Server 2003(带有 IE11 的 ASP.NET WebForms 4.0 站点不会为 Windows Server 2003 上的 PageRequestManager 加载 ScriptResource)
本文介绍了带有 IE11 的 ASP.NET WebForms 4.0 站点不会为 Windows Server 2003 上的 PageRequestManager 加载 ScriptResource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Windows Server 2003 上运行的 IE11 和 ASP.NET Web 窗体 (.NET 4.0) 时遇到问题.在 IE11 上,以下脚本标记未出现在源 HTML 中:

I am having a problem with IE11 and ASP.NET Web Forms (.NET 4.0) that runs on Windows Server 2003. On IE11, the following script tag does not appear in the source HTML:

<代码>< SCRIPT SRC = /的ScriptResource.axd d = WYhXIHdkh3HFOMewc5Dscl74H0FlrdD4oOAIu08capt3uxzykhWmBntlCyp0ApmvoCoZjoSCP5s1mUjzhOe99tXFvkHJ2vmkIMEuekr4y9dZdi8 - YB4rXK6XO-B-mgnKReGNiAy9wDYm6lNNWWtBg2&安培; amp; T公司= ffffffffbd2983fc" 类型= 文本/JavaScript的" ></脚本>

随后 IE11 报告:

And subsequently IE11 reports:

Unable to get property 'PageRequestManager' of undefined or null reference

它在所有其他浏览器中都能正常工作.

It works fine in all other browsers.

我猜这与浏览器定义有关.有谁知道如何解决这个问题?

I guess it has something to do with Browser Definitions. Any one knows how to fix this problem?

更新:

该网站在我装有 Windows 7 和 Visual Studio 2013 以及 .NET 4.5.1 的本地计算机上运行.

The web site works on my local computer with Windows 7 and Visual Studio 2013 and .NET 4.5.1.

您无法在 Windows Server 2003 上安装 .NET 4.5 或 4.5.1,因此我们无法使用这些软件包更新服务器,但我们必须使用 .NET 4.0.

You cannot install .NET 4.5 or 4.5.1 on Windows Server 2003, and therefore we cannot update the server with these packages, but we have to do with .NET 4.0.

此外,服务器似乎将浏览器识别为低级浏览器,因为Auto"上的会话 cookie 支持将模式设置为cookieless",因此 cookie 被写入为 URL 的一部分.

Also, it seems that the server recognizes the browser as low-level browser, because session cookie support on "Auto" sets the mode to "cookieless", so that cookie is written as a part of the URL.

希望这些信息能帮助我们解决问题.

Hope this information helps us to solve the problem.

谢谢!

推荐答案

我们终于从以下问题中找到了答案:

We found finally the answer from the following question:

在 IE11 预览版中未定义WebForm_DoPostBackWithOptions"

我们在 App_Browsers 中有 CSSFriendlyAdapters.browser 文件,这导致了问题.

We had CSSFriendlyAdapters.browser file in App_Browsers, which caused the problem.

我们不得不

1) 创建 ie11.browser 文件如下:

1) create ie11.browser file as follows:

<browsers>
  <browser id="IE11" parentID="Mozilla">
    <identification>
      <userAgent match="Trident/7.0; rv:(?'version'(?'major'd+)(.(?'minor'd+)?)(?'letters'w*))(?'extra'[^)]*)" />
      <userAgent nonMatch="IEMobile" />
    </identification>
    <capture>
      <userAgent match="Trident/(?'layoutVersion'd+)" />
    </capture>
    <capabilities>
      <capability name="browser"              value="IE" />
      <capability name="layoutEngine"         value="Trident" />
      <capability name="layoutEngineVersion"  value="${layoutVersion}" />
      <capability name="extra"                value="${extra}" />
      <capability name="isColor"              value="true" />
      <capability name="letters"              value="${letters}" />
      <capability name="majorversion"         value="${major}" />
      <capability name="minorversion"         value="${minor}" />
      <capability name="screenBitDepth"       value="8" />
      <capability name="type"                 value="IE${major}" />
      <capability name="version"              value="${version}" />
    </capabilities>
  </browser>

  <!-- Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11,0) like Gecko -->
  <browser id="IE110" parentID="IE11">
    <identification>
      <capability name="majorversion" match="11" />
    </identification>

    <capabilities>
      <capability name="ecmascriptversion"    value="3.0" />
      <capability name="jscriptversion"       value="5.6" />
      <capability name="javascript"           value="true" />
      <capability name="javascriptversion"    value="1.5" />
      <capability name="msdomversion"         value="${majorversion}.${minorversion}" />
      <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" />
    </capabilities>
  </browser>
</browsers>

2) 然后从bin目录中删除__browserCapabilitiesCompiler.compiled.

2) And then delete __browserCapabilitiesCompiler.compiled from the bin directory.

现在一切正常!

我希望这也能帮助遇到同样问题的其他人!

I hope this helps also others who are having the same problem!

这篇关于带有 IE11 的 ASP.NET WebForms 4.0 站点不会为 Windows Server 2003 上的 PageRequestManager 加载 ScriptResource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)
Custom model binding in AspNet Core WebApi?(AspNet Core WebApi中的自定义模型绑定?)
How to minify in .net core mvc view?(如何在.Net核心MVC视图中缩小?)