asp.net 项目在 IE 11 下出现 “__doPostBack”未定义 的解决办法
最近项目在 IE 11 下<asp:LinkButton> 点击出现 “__doPostBack”未定义”,经过一番google,终于知道了原因:ASP.NET 可能无法辨识出一些浏览器的最新版本,还会经常把它们看做是低级的浏览器。(也就是: 不支持JavaScript。)
详见: http://blogs.msdn.com/b/scott_hanselman/archive/2011/10/28/asp-net-ie10-dopostback-javascript-ff5.aspx
本人按照该文所提供的解决办法始终未能得到解决,于是按提示尝试用单个站点的方式修复。
在项目根目录 App_Browsers 下新建 浏览器文件(.browser),让其与IE11的 UserAgent 匹配,使 .net framework 认识这是一个已知的浏览器,可以正常地向客户端输出脚本。
在文件里输入以下内容,保存即可。
<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>
自己在项目中添加的文件:
<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="" />
<capability name="type" value="IE${major}" />
<capability name="version" value="${version}" />
</capabilities>
</browser> <!-- Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:,) like Gecko -->
<browser id="IE110" parentID="IE11">
<identification>
<capability name="majorversion" match="" />
</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>
asp.net 项目在 IE 11 下出现 “__doPostBack”未定义 的解决办法的更多相关文章
- 【转】asp.net 项目在 IE 11 下出现 “__doPostBack”未定义 的解决办法
最近我们运营的网站有用户反馈在 IE 11 下<asp:LinkButton> 点击出现 “__doPostBack”未定义”,经过一番google,终于知道了原因:ASP.NET 可能无 ...
- asp.net 项目Net4.0 在IE10、 IE 11 下出现 “__doPostBack”未定义 的解决办法
我的项目中,服务器端是Windows Server2008 64位,.net版本是4.0,也遇到了树形结构控件.DropDownList控件等不能调用服务器端代码.最后发现js报错. 错误信息:“__ ...
- asp.net项目在IE11下出现“__doPostBack”未定义的解决办法
最 近我们运营的网站有用户反馈在 IE 11 下<asp:LinkButton> 点击出现 “__doPostBack”未定义”,经过一番google,终于知道了原因:ASP.NET 可能 ...
- 【转】asp.net项目在IE11下出现“__doPostBack”未定义的解决办法
最近我们运营的网站有用户反馈在 IE 11 下<asp:LinkButton> 点击出现 "__doPostBack"未定义",经过一番google,终于知道 ...
- phpcmsV9中表单向导在js调用里日期控件在IE下报Calendar未定义的解决办法
最近在phpcmsV9里用表单向导弄个的提交表单,但用了日期和时间类型时,用 <script language='javascript' src='{APP_PATH}index.php?m ...
- eclipse中项目jdk1.8刷新下就变成1.5的解决办法
https://blog.csdn.net/qq_32814555/article/details/82803017 ***************************************** ...
- Tomcat因项目迁移,启动窗口一闪而过,启动失败的解决办法。
笔者手动部署一个web项目到Tomcat/webapps/目录下,成功运行.后来,项目结束,我把webapps下的姓项目文件夹删除.重启Tomcat时,运行...\apache-tomcat-8.5. ...
- MySQL 5.7 Command Line Client输入密码后闪退和windows下mysql忘记root密码的解决办法
MySQL 5.7 Command Line Client输入密码后闪退的问题: 问题分析: 1.查看mysql command line client默认执行的一些参数.方法:开始->所有程序 ...
- html页面顶部出现一段空白,检查控制台发现body 下出现字符,原因及解决办法
html页面顶部出现一段空白,检查控制台发现body 下出现字符,原因及解决办法 分析: 原来是页面编码时增加了BOM,此页面后端数据主要是PHP语言,对PHP来讲PHP在设计时 ...
随机推荐
- safedog的小技巧
限制3389连接:下载SafedogServer\SafeDogGuardCenter\ProGuardData.ini回本地,然后本地搭建安全狗,覆盖,查看计算机名,修改自己计算机名再连接. 卸载安 ...
- php 数组操作
<?php $vegetables[0] = "corn"; $vegetables[1] = "broccoli"; $vegetables[2] = ...
- Ctrl+Shift+F12切换最大化编辑器
常用快捷键(keymaps:Default情况下) Esc键编辑器(从工具窗口) F1帮助千万别按,很卡! F2(Shift+F2)下/上高亮错误或警告快速定位 F3向下查找关键字出现位置 F4查找变 ...
- NBOJv2 1034 Salary Inequity(DFS序+线段树区间更新区间(最值)查询)
Problem 1034: Salary Inequity Time Limits: 10000 MS Memory Limits: 200000 KB 64-bit interger IO ...
- cordova -v 报错,必须用sodu cordova -v
问题来源:MAC Caption EI 安装nodejs 4.5.0 之后,用命令:sudo npm install -g cordova ionic 安装cordova 和 ionic 然后用命令: ...
- 2016.05.03,英语,《Vocabulary Builder》Unit 21
sub, means 'under', as in subway, submarine, substandard. A subject is a person who is under the aut ...
- PHP 错误与异常 笔记与总结(14 )记录和发送异常信息
当发生异常时,把异常信息记录到日志文件中: <?php header('content-type:text/html; charset=utf-8'); class LogException e ...
- PHP学习(五)----jQuery和JSON数据
对于jQuery: jQuery 是一个 JavaScript 库. jQuery 极大地简化了 JavaScript 编程.
- Introduction to Structured Data
https://developers.google.com/search/docs/guides/intro-structured-data Structured data refers to kin ...
- locations in main memory to be referenced by descriptive names rather than by numeric addresses
Computer Science An Overview _J. Glenn Brookshear _11th Edition Chapter 6 Programming Languages As s ...