如何避免使用IE 11的兼容性问题? [英] How to avoid compatibility issue using IE 11 ?

查看:93
本文介绍了如何避免使用IE 11的兼容性问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何避免使用IE 11的兼容性问题?



我在Asp.net开发了一个应用程序并托管了相同的应用程序。当我在IE 8中浏览网站时,它工作正常。但是在IE 11中,我没有收到菜单,有日期选择器问题等。



我试图在IE 8中强制使用兼容模式。但它不起作用。

 <   httpProtocol  >  
< customHeaders < span class =code-keyword>>
< clear / >
< add name = X-UA兼容 = IE = 8 / >
< / customHeaders >
< / httpProtocol >

解决方案

一定是css问题。



有些css标签需要删除或添加。



一旦发现问题。在主/个人页面中有条件地应用css,如下所示。



 <! -     [if IE 8]> 
< div id =wrapperclass =ie8>其他元素< / div>
<![endif]
- >







在上面的例子中,我创建了ie8类,如果在IE8中加载了网页,它将应用于id为包装的元素。



如果有多个页面,则创建单独的css文件,然后将其添加到主/个人页面,如下所示。



< pre lang =xml> <! - [if IE 8 ] GT;
< link rel =stylesheettype =text / csshref =path / to / stylesheet.css>< / link>
<![endif]
- >







当然可行。试试。


听起来好像你遇到了这个浏览器嗅探问题 [ ^ ],几年前修补了。



为您的框架版本和操作系统安装相关补丁:



当你是在它,检查系统中缺少哪些补丁。



要快速修复,请尝试设置 Page.ClientTarget 属性 [ ^ ]到字符串uplevel,以强制ASP.NET假设所有请求都来自最近的浏览器。


How to avoid compatibility issue using IE 11 ?

I have developed an application in Asp.net and has hosted the same. When I browse the site in IE 8 it works fine. But in IE 11 I am not getting the menu, having Date Picker Issues etc.

I tried to force the compatibility mode in IE 8. But it isn't working.

<httpProtocol>
     <customHeaders>
       <clear/>
       <add name="X-UA-Compatible" value="IE=8"/>
     </customHeaders>
   </httpProtocol>

解决方案

It must be css issue.

Some css tags need to be removed or add.

Once you find issue. Apply css conditionally like below in master/individual page.

<!--[if IE 8]>
<div id="wrapper" class="ie8">Other elements</div>
<![endif]-->




In above example, I've created ie8 class which will be apply to element having id is wrapper if web page is loaded in IE8.

If there are multiple page then create separate css file and then add it to master/individual page like below.

<!--[if IE 8]>
    <link rel="stylesheet" type="text/css" href="path/to/stylesheet.css"></link>
<![endif]-->




Sure it will work. Try.


Sounds like you're running into this browser-sniffing issue[^], which was patched several years ago.

Install the relevant patch for your framework version and OS:

While you're at it, check which other patches are missing from your system.

For a quick-fix, try setting the Page.ClientTarget property[^] to the string "uplevel" to force ASP.NET to assume all requests come from a recent browser.


这篇关于如何避免使用IE 11的兼容性问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆