本文介绍了IE 11+ Windows 8.1中的doPostback失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我在Windows 8.1预览中的IE 11中得到空白页。检查页面后,我认为以下代码可能是罪魁祸首,因为在这些行之后没有进一步显示调试器窗口的行,所以代码在这行之后就破了。I am getting blank page in IE 11 in Windows 8.1 Preview.After Inspecting the page I assumed that following code might be the culprit,since after these line there is not further line displayed debugger window, So code is breaking after this line. IE 11IE 11<!-- <form name="aspnetForm" method="post" action="Register" id="aspnetForm"><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTkwNDQ3O我在Windows 8.1预览版Chrome 29.0.1547.57 m中尝试了相同的页面它在那里正常工作,我得到了以下代码。I tried the same page in Chrome Version 29.0.1547.57 m in Windows 8.1 Preview It is working fine there and I get following code. CHROMECHROME<script type="text/javascript">//<![CDATA[var theForm = document.forms['aspnetForm'];if (!theForm) {theForm = document.aspnetForm;}function __doPostBack(eventTarget, eventArgument) {if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit();}}//]]></script> - >推荐答案你可能在绊倒b的问题IIS上的rowser检测。 Scott Hanselman 过去曾用IE10写过这个问题,你遇到的问题是什么?似乎反映了他的描述。Its likely that you're tripping over an issue with the browser detection on IIS. Scott Hanselman wrote about this in the past with IE10, and the problem you're having does appear to mirror his description.当时可用的修补程序, http://support.microsoft.com/kb/2600088 ,声明:A hotfix available at the time, http://support.microsoft.com/kb/2600088, stated: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)但是,由于新的用户代理格式,此修补程序似乎不适用于IE11。有一个名为App_Browsers的NuGet包可能包含修复程序,但在此之前你必须编写自己的规则。However, this hotfix appears not to apply to IE11 due to a new format of user agent. There is a NuGet package named App_Browsers that may contain a fix, but until then you will have to write your own rule. MSDN浏览器定义文件架构给出有关如何编写浏览器检测文件的详细信息;你会发现你现有的文件在C:\ Windows \ Mesrosoft.NET \ Framework \v4.0.30319 \Config \浏览器。MSDN Browser Definition File Schema gives details on how to write a browser detection file; you will find your existing files in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers.根据 IE11预览中的MSDN兼容性更改,预览中IE11的用户代理是:According to MSDN Compatibilty Changes in IE11 Preview, the user agent for IE11 in Preview is: Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko标准IE正则表达式无法识别(因此您遇到的问题),但是以下应该起作用:which is not recognised by the standard IE regex (hence the problem you're seeing), however the following should work instead: Trident\/7.0; rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)我没有在实时环境中对它进行测试,但这确实解析了主要的正确的次要版本,这是解决原始问题的关键 - 尝试将此添加为文件中的另一个匹配 ie.browser 。I've not tested it in a live environment, but this does parse the major and minor version correctly, which are key to solving the original problem - try adding this as another match in the file ie.browser. 请注意最近在MSDN上提出了一个类似的问题 - 可能值得关注并做出贡献。Note that a similar question was asked on MSDN recently - it may be worthwhile following and contributing to that. 这篇关于IE 11+ Windows 8.1中的doPostback失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-26 18:33
查看更多