Intranet Site doesnt display in IE9 (Intermittent) - html

I have an ASP MVC 3 website which is used on the intranet. It uses Windows Authentication and I've noticed sometimes on just a few user's machines (they all use IE9), it just doesnt load and the user is presented with a white screen or "Internet Explorer cannot display this page" message.
I've set <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> in my <head> tag and I've also unchecked the box "Display intranet sites in compatibility mode" under tools > Compatibility View Settings in IE9.
I'm running out of ideas as to what is causing this issue. It's intermittent too which is all the more puzzling. It works fine on everyone else's machine (some even use IE9 and the rest use IE8).

Since you're using ASP.NET MVC3, I'd strongly recommend installing Glimpse. It'll help you see what's happening on the server when the requests fail. Granted, you'd probably want to configure it to require authentication, but it can also be turned on and off in the web.config if you just need to it be available temporarily.

Related

Should HTML meta tags be avoided for Edge?

When one of our users tries to open our site in Edge, it instead opens in IE. I understand there are some settings on their machine that may trigger this based on my research (group policies, intranet sites, compatibility modes, etc.)
In looking, I found this MS page https://learn.microsoft.com/en-us/microsoft-edge/deploy/emie-to-improve-compatibility
It says that "You must continue using IE11 if web apps use... <meta> tags". I don't know if this means that any and all <meta> tags will trigger the "open it in IE" behavior, or if they're just recommending it.
I also thought things like <meta charset="UTF-8" /> were highly important. We also use a <meta> tag to indicate viewport dimensions/scaling/etc.
Should I avoid all <meta> tags? Or just <meta http-equiv="X-UA-Compatible" content="IE=edge">? I need to prevent the site from kicking over to IE from my end of things without relying on whatever the user has done to their settings (if possible).
I would like to know if your website is intranet site, if so, since Edge has a group policy
​which opens all the intranet sites in IE, you could try the following steps:
Open Local Group Policy Editor.
Select "Administrative Templates".
Select "Windows Components".
Select "Microsoft Edge". Once you double click "Microsoft edge" you will see different settings & their current state.
Select "Send all intranet sites to Internet Explorer 11" and then "Disabled" it.
Quit Edge & re-start (if required you might re-start your PC as well).

IFrame with html content in IE11 gives navigation to the webpage was cancelled

I have an IFrame with src set to the html content that I receive from a web service. This html content has meta
http-equiv="x-ua-compatible" content="IE=Edge"
in the head but in IE11, I am getting "Navigation to the webpage was cancelled" message within the IFrame.
I also get a pop up with "You will need a new app to open this data" in IE.
The iframe content is however displayed well and good in Chrome.
Things I tried to make it work in IE:
1) Replace iframe src with srcdoc. Did not work.
2) Enable Launching programs and files in Iframe in IE settings. Did not work.
3) Set Default app setting as IE as default browser. Did nothing.
Nothing works. Please suggest a workaround for this?
You may receive this error message when a site or program is in a different Internet Explorer Security Zone.
You can try to disable the protected mode to check whether it solves your issue or not.
Further, You can try to set the IE security to low level and make a test again.
You can also try to reset the IE to it's default setting and check whether it helps to solve the issue.
You can refer the link below that may give you some additional information on this topic.
Navigation is canceled when you browse to Web pages that are in different Internet Explorer security zones

WebBrowser blocking adsense ad code in vb6 WebBrowser

Currently in vb6 project with WebBrowser i am facing a problem. I want to show adsense ad in my app so i create a html page and put the file in server(adsense approved) and I tried to navigate the page from vb6 project with WebBrowser. but everytime its showing some script error. What to do to fix it? please help
The problem is probably because the Browser Control runs in document mode 7, so it's essentially emulating IE 7. You can override that with registry entries, but those need to be made on a per application (appname.exe) basis.
A better solution usually is to include the document mode meta tag in your html: <meta http-equiv="X-UA-Compatible" content="IE=edge">.
SO question with an extensive answer descriptions on that meta tag: What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?
Point 1: The WebBrowser control in VB (and later Visual Studio) is not a fully functioning browser like we expect from Chrome, IE, Firefox etc. It has severe limitations.
Point 2: I doubt very much that VB6 has any knowledge of AdSense.
You would probably be better off using VB6 to launch the default browser on the user's computer with relevant parameters and let it deal with whatever page you throw at it.
You would probably be better off at least moving to VB 2008 - there are problems with conversion, but they are do-able and from VB 2008 you can easily move on eventually to more modern variants.

Does the X-UA Compatible http header actually work for IE9?

I'm working on a web product that may be hosted as an intranet site. I'm trying to find a programmatic way to keep IE9 from slipping into IE9 Compatibility View browser mode, even though 'Display Intranet sites in Compatibility View' may be on.
I'm testing with this html page:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<title>Company</title>
</head>
<body>
</body>
</html>
I've put this in IIS config:
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
as recommended here: https://stackoverflow.com/a/5887546, and checked the response headers in IE9 and see:
X-UA-Compatible IE=Edge
But the page still puts the browser in Compatibility View browser mode.
The console shows:
HTML1202: http://intranet-site/test.html is running in Compatibility View because 'Display intranet sites in Compatibility View' is checked.
test.html
There's a similar question here: https://stackoverflow.com/a/3726605/1279516, in which a comment by Jacob on the chosen answer suggests that in IE9, there's nothing you can do to override the 'Display Intranet sites in Compatibility View' setting. However, his comment is the only place I've found mention of this. Can anyone confirm or deny that assertion?
And is there anything else I can try? I shouldn't have to tell all clients who deploy our product to uncheck the 'Display intranet sites in Compatibility View' browser setting for all their users.
Unless someone says otherwise, oryol's comment suggests that all features are made available based on Document Mode, so there's no need to try to control browser mode further once you are getting the document mode you want.
I ran into a similar issue - page not rendering correctly in IE8/9 because Display Intranet sites in Compatibility View was on. Asking all users to disable this or asking for a group policy and adding exceptions for I do not know how many other intranet pages requiring this was not an option.
The document mode is OK thanks to the X-UA-Compatible: IE=edge. But I still had the layout issues.
Cause:
Compatibility mode causes IE to send another user agent to the server. For IE8,9 this is that of IE7.
Some of my ASP.NET libraries does some checks based on that and renders IE7 specific HTML/CSS that results in layout issues.
Solution:
Modify the UserAgent string on the server to "IE9" if it says "IE7". Of course this is a dirty solution since in theory there could be a real IE7 client.
In my cause (Intranet) I know my users only have IE >= 8.
Changing the UserAgent proved harder than anticipated. I successfully applied this idea - deriving a subclass from HttpWorkerRequest and intercepting requests for UserAgent. This indirectly overloads request.UserAgent and helped solve the problem.

How to avoid ie8 compatibility button?

In IE8, the Microsoft introduced a new mode called compatibility mode which would render the page like IE7.
You can see this button next to address bar in stackoverflow.com. But when you access google.com / live.com, you would not see the compatibility mode button. How do we make sure the pages don't show this button the user?
Short answer:
Put this in your head tag to tell the browser that your page works in IE 8:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
Also as per Jon Hadleys comment, to ensure the latest (not just IE8) rendering engine is used, you could use the following:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
From here:
Sometimes the Compatibility View
button isn’t displayed.
The button is located on the address
bar next to the ‘stop’ and ‘refresh’
buttons. There are a few cases where
there’s no action for a user take and,
thus, the Compatibility View button
will not show:
If you're viewing an
internal-to-Internet Explorer page
(such as about:InPrivate)
If you're viewing a page that has declared it's
"ready" for Internet Explorer 8
through use of the versioning
tag / HTTP header (it doesn’t matter
if this tag triggers Quirks, IE7
Standards, or IE8 Standards, the
button won’t be displayed)
If you're viewing an intranet page and you have
the ‘Display intranet sites in
Compatibility View’ checkbox selected
If you're viewing any webpage and you
have the ‘Display all websites in
Compatibility View’ checkbox selected
If you're viewing a webpage that is
included on the Microsoft-supplied
compatibility view updates list and
you have the ‘Include updated website
lists from Microsoft’ checkbox
selected
If you've toggled either the
‘Document Mode’ or ‘Browser Mode’
settings via the Developer Toolbar
So you're probably after the versioning tag / HTTP header which is described in more details in that blog post and over here.
If the "Display intranet sites in Compatibility View" or "Display all websites in Compatibility View" settings (found under Tools -> Compatibility View Settings) are enabled (as they relate to the website being viewed), then no matter what you have in the HTML of the document, the page will always be put in to some form of compatibility view.
This means that, even with in the document, you will still notice that the page is put in to compatibility view, and nothing you can do except disabling those settings will disable it, unfortunately.
As per this comprehensive MSDN article on Compatibility View, the following list describes different ways that enable Compatibility View:
You click the Compatibility View button in the Address bar when viewing a webpage. When displayed, this button appears to the left of the Refresh button and contains an image of a broken piece of paper. This enables Compatibility View for all documents in the domain of the website being viewed.
The "Display all websites in Compatibility Mode setting" in the Compatibility View Settings is enabled.
The "Automatically recover from page layout errors with Compatibility View" setting is enabled and a webpage stops responding or crashes the browser. When this happens, Internet Explorer opens the page in Compatibility View after recovering from the problem.
Group policies that identify sites to be opened in Compatibility View are enabled by the administrator of your computer.
You have used the F12 developer tools to change the browser mode to identify Internet Explorer as an earlier version of the browser.
The Compatibility View List is enabled, which defines a list of websites that are automatically displayed in Compatibility View.
To avoid/disable/override Compatibility View, you'll have to do the reverse of the actions suggested above.
The Compatibility View list is an XML file maintained by Microsoft.
To remove your site from the Compatibility View List (or to dispute
the removal of your site from the list), have the overall site owner
verify that the domain site appears in the Compatibility View List. If
it does, send an e-mail to iepo#microsoft.com that contains the
following information:
Owner name Corporate title Company name Street address Email address
Telephone number Website address
Microsoft will review the provided information and remove your site
from the Compatibility View List at the next scheduled update.
Below link was working fine in IE and it was showing menu bar properly
http://line25.com/wp-content/uploads/2012/css-menu/demo/index.html
But same content hosted on intranet, all links were displayed one below other instead of menu bar. Compatibility view button was not shown in address bar.
After below change, the menu bar got displayed correctly and compatibility view button got displayed in address bar.
Tools->Compatibility view settings->Uncheck "Display intranet sites in compatibility view"
Thanks a lot for this valuable input
I was having an issue with compatibility view, and it turned out some of my PHP files were being saved in UTF-8 character encoding, which I guess was confusing IE. The majority of the site files were saved in Codepage 1252.
Now, I set all the files to save as "Western European (Windows) - Codepage 1252" and my display issues went away.
The lesson here is, don't mix your character encodings.