简体   繁体   中英

ASP.NET Internet Explorer 11 Not Displaying on some servers

We have an application (ASP.NET) that has been working without issue on IE8. Teh application is running on two servers, one primary and one testing. Since the application has been stable for some time, the code on both servers is currently identical.

Our company is currently testing migration to IE11. We noticed that on the production server, some pages are not displayed in IE11. Instead, they message "This page can't be displayed" is shown. However all the pages are being displayed correctly when we point to the test server.

What possible configuration issues, either on the server, client, or global IE settings should I look at to identify what's causing the compatibility issues?

I'm going to take a guess here: The production server is on the open internet, and the test server is hidden inside your company network. Is that right?

If that's the case, then the problem is likely down to compatibility mode (or the lack of it) and your browser settings.

IE has a config setting (that defaults to being switched on), which tells it to use IE7-compatibility-mode for sites within the local network.

My guess is that since your site works fine in IE8, it also works fine in IE7-compatibility-mode, and thus works fine on your test server which is in your local network.

However, your live server is on the open internet, and thus IE doesn't use that config setting, and tries to render the page in IE11 standards mode. Since your site was written to work in IE8, it probably has bugs or issues that cause it to render badly in newer browsers like IE11, which is what you're seeing.

If this diagnosis is correct, then you have two options:

  1. Fix the bugs, and set the site to use IE11 standards mode.

  2. Leave the bugs as they are and set the site to use compatibility mode.

In either case, you're going to want to make use of the X-UA-Compatible meta tag or http header.

In meta tag form, this looks like this:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

...to set it to IE8 compatibility mode.

To set it to IE11 mode, use IE=edge instead of IE-8 in the line above.

This line needs to be added to the <head> section of your HTML code on every page in your site. It can also be added as a http header. This may be a better option if you cannot change the html code, but exact details of how to do that will depend on your web server so I'll leave you to research that for yourself if you want to take that route.

Note that setting it to use compatibility mode is obviously the quicker option, since you won't have to make any other change to the code. However be aware that the bugs that cause it to break in IE11 will also break it in other browsers, including Microsoft's Edge browser, which is the replacement for IE in Windows 10. In other words, you will have to fix those bugs sooner or later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM