Browser version numbers continue to march on. IE9 is here, IE10 is coming, Firefox 5 and 6 are here with 7 and 8 in the wings, Opera's on 11, and Chrome is on, I dunno, somewhere between 14 and 50. Regardless, we'll all be on version 99 before The Singularity.
浏览器版本号继续前进。 IE9即将发布, IE10即将发布, Firefox 5和6即将发布,其中7和8即将发布,Opera启用11,Chrome启用,我不知道,介于14到50之间。无论如何,我们都将使用版本99在奇点之前。
There is a bug in the browser definition files that shipped with .NET 2.0 and .NET 4, namely that they contain definitions for a certain range of browser versions. But the versions for some browsers (like IE 10) aren't within those ranges any more. Therefore, ASP.NET sees them as unknown browsers and defaults to a down-level definition, which has certain inconveniences, like that it does not support features like JavaScript.
.NET 2.0和.NET 4附带的浏览器定义文件中存在一个错误,即它们包含特定范围浏览器版本的定义。 但是某些浏览器(例如IE 10)的版本已不在这些范围内。 因此,ASP.NET将它们视为未知的浏览器,并且默认为下级定义,该定义具有某些不便之处,例如它不支持JavaScript之类的功能。
If you want to see this for yourself, create a new, blank Web site (e.g. in Visual Studio 2010), add a control that requires JavaScript for postback (good example: <asp:LinkButton>), and then run the site using IE9 (where it works) and IE10 (where it won't). View the page source and compare the HTML and JavaScript sent to each browser.
如果您想亲自查看,请创建一个新的空白网站(例如在Visual Studio 2010中),添加一个需要JavaScript进行回发的控件(很好的示例:<asp:LinkButton>),然后使用IE9运行该网站(适用于该产品)和IE10(适用于该产品)。 查看页面源,并比较发送给每个浏览器HTML和JavaScript 。
A similar bug affects Firefox versions 5 and above, where support for using JavaScript to reposition the scrollbar in the browser is not detected. This basically breaks the MaintainScrollbackPositionOnPostBack property for Web Forms pages.
类似的错误会影响Firefox 5及更高版本,在该版本中未检测到使用JavaScript在浏览器中重新定位滚动条的支持。 这基本上破坏了Web窗体页面的MaintenanceScrollbackPositionOnPostBack属性。
These "misdetection" bugs affect Web Forms pages in both ASP.NET 2 and ASP.NET 4. If you are using ASP.NET Web Pages, or if you're using ASP.NET MVC or ASP.NET Web Pages and are not using the Browser object to detect JavaScript support, you will not be affected.
这些“错误检测”错误会影响ASP.NET 2和ASP.NET 4中的Web窗体页面。如果您使用的是ASP.NET网页,或者使用的是ASP.NET MVC或ASP.NET网页,而没有使用浏览器对象检测JavaScript支持,您将不会受到影响。
修正 (Fixes)
There are two ways to fix this: one is a machine-wide fix, the other is a way to fix individual sites.
有两种解决方法:一种是计算机范围的修复,另一种是修复单个站点的方法。
机器范围内的修复 (Machine-wide fixes)
We're releasing a hotfix that will fix these, which you'll be able to get to via some KB articles. These KBs with fixes are live and are the best way to update your system. The fixes solve the browser-detection issue forever for all sites on a machine. These will be rolled up into future versions of the framework and will eventually also be on Windows Update.
我们将发布一个修复程序,将修复这些问题,您可以通过一些知识库文章获得此修复程序。 这些带有修复程序的知识库是实时的,并且是更新系统的最佳方法。 该修补程序将永远解决计算机上所有站点的浏览器检测问题。 这些将汇总到该框架的将来版本中,并最终也将在Windows Update上。
- .NET 2.0 .NET 2.0
http://support.microsoft.com/kb/2600100 for Win7 SP1/Windows Server 2008 R2 SP1, Windows Vista/Server 2008, Windows XP/Server 2003
http://support.microsoft.com/kb/2600100,用于Win7 SP1 / Windows Server 2008 R2 SP1,Windows Vista / Server 2008,Windows XP / Server 2003
http://support.microsoft.com/kb/2608565 for Win7/Windows Server 2008 R2 RTM
对于Win7 / Windows Server 2008 R2 RTM, http://support.microsoft.com/kb/2608565
What the fixes do is update the ie.browser and firefox.browser files in \Windows\Microsoft.NET\Framework\<version>\Config\Browsers with new and future-proofed versions of these browser definitions. Nothing else is affected.
该修补程序的作用是更新\ Windows \ Microsoft.NET \ Framework \ <version> \ Config \ Browsers中的ie.browser和firefox.browser文件。 这些浏览器定义的新版本和面向未来的版本。 没有其他影响。
仅网站修复 (Site-only fixes)
If you don't have access to the whole machine and/or just want to update a single project, use NuGet to install the App_BrowsersUpdate package. Your site structure in Solution Explorer will then look like the image at right. Note that NuGet uses .NET 4, so for systems that have only .NET 2, you'll need to get the ZIP file and put the new browser files in App_Browsers manually.
如果您无权访问整个计算机和/或仅想更新单个项目,请使用NuGet安装App_BrowsersUpdate软件包。 解决方案资源管理器中的站点结构将如右图所示。 请注意,NuGet使用.NET 4,因此对于只有.NET 2的系统,您需要获取ZIP文件并将新的浏览器文件手动放入App_Browsers中。
.NET 4 Browser Update NuGet Package - http://nuget.org/List/Packages/App_BrowsersUpdate
.NET 4浏览器更新NuGet软件包-http://nuget.org/List/Packages/ App_BrowsersUpdate
install-package App_BrowsersUpdate
安装软件包App_BrowsersUpdate
.NET 4 Browser Update NuGet Package - http://nuget.org/List/Packages/App_BrowsersUpdate
.NET 4浏览器更新NuGet软件包-http://nuget.org/List/Packages/ App_BrowsersUpdate
.NET 2.0 Browser Update NuGet Package - http://nuget.org/List/Packages/App_BrowsersUpdate.net20
.NET 2.0浏览器更新NuGet程序包-http://nuget.org/List/Packages/ App_BrowsersUpdate.net20
install-package App_BrowsersUpdate.net20
安装软件包App_BrowsersUpdate.net20
Note that NuGet is VS2010 specific so if you don't have nuget.exe and .NET 4, you can also copy the .NET 2 updated browser files into ~\App_Browsers manually from this zip file.
请注意,NuGet是特定于VS2010的,因此,如果您没有nuget.exe和.NET 4,则还可以从此zip文件手动将.NET 2更新的浏览器文件复制到〜\ App_Browsers中。
.NET 2.0 Browser Update NuGet Package - http://nuget.org/List/Packages/App_BrowsersUpdate.net20
.NET 2.0浏览器更新NuGet程序包-http://nuget.org/List/Packages/ App_BrowsersUpdate.net20
Updating the whole machine is the preferred way to fix this.
更新整个计算机是解决此问题的首选方法。
概要 (Summary)
- ASP.NET might not recognize the most current versions of some browsers, and will consequently treat them as down-level browsers. (Basically: no JavaScript.) ASP.NET可能无法识别某些浏览器的最新版本,因此会将它们视为下层浏览器。 (基本上:没有JavaScript。)
- The fix is to get updated browser-definition files. 解决方法是获取更新的浏览器定义文件。
You can install a machine-wide fix or just fix individual projects.
您可以安装计算机范围的修复程序,也可以仅修复单个项目。
Hotfixes are availble with download links.
修补程序可通过下载链接获得。
.NET 2.0 - http://support.microsoft.com/kb/2600100
.NET 2.0- http://support.microsoft.com/kb/2600100
- The files will also be part of the next batch of .NET 4 fixes, which are anticipated to ship around January 2012 via Windows Update. 这些文件也将是下一批.NET 4修复程序的一部分,预计将在2012年1月左右通过Windows Update发行。
- The next version of the .NET framework will include all the updated files. .NET框架的下一版本将包含所有更新的文件。
If you're interested in more detail than you need, I’ve uploaded the updated versions of firefox.browser and ie.browser files that are expected to ship with the next version of ASP.NET. The files and source is up at my BitBucket repo if you are interested in the details.
如果您对所需的详细信息感兴趣,我已上载了预期版本的ASP.NET附带的firefox.browser和ie.browser文件的更新版本。 如果您对详细信息感兴趣,文件和源位于我的BitBucket存储库中。