Internet Explorer compatibility mode - asp.net

I have a ASP.NET web application which is supposed to work on IE.
If I go to compatibility View Settings and uncheck Display intranet sites in Compatibility View and the domain is not added in the box Websites you've added in Compatibility View, the users sees the code not the forms of the page.
If I check the checkbox, he still sees the code, only after I add it in the box I can see the actual forms of the page.
I tried
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=IE5" />
</customHeaders>
</httpProtocol>
</system.webServer>
but still the same problem.
Is there another way to force it from code? I understand in the future the checkbox will be disabled so I must find I way to force the compatibility mode.
Can I add it to the box for Compatiblity View from code?

Related

ASP.NET Ajax Toolkit Slider handle displays broken image

Using ASP.NET 4.5 Web Forms project that has been running for years and a new problem arose: the ASP.NET Ajax Control Toolkit Slider stop rendering an image (its a broken image symbol where the "handle" usually renders).
This only happens in IE11. Its working OK in Chrome nor Firefox (below):
Currently reviewing recent changes to code made (we've been doing an annual security review on OWASP Top 10) to see what may have broken it, but any advice appreciated.
Edit: recently we have been adding entries to our web.config customHeaders section per https://scotthelme.co.uk/hardening-your-http-response-headers
When we set X-Content-Type-Options=nosniff in web.config as below:
</system.webServer>
...
<httpProtocol>
<customHeaders>
<add name="X-Content-Type-Options" value="nosniff" />
</customHeaders>
</httpProtocol>
</system.webServer>
the slider breaks in E11. When the above is removed, the slider works in IE11.
I don't fully understand why, but this appears to be our culprit.

external page and iframe issue

I have 2 websites hosted on windows server 2012. One website is using asp.net while other is wordpress. I want to embed asp.net page in wordpress. But, it is not showing anything. I did some research and came to know that perhaps, I have to allow permission for external website. Please guide me how to do it, should I add anything in web.config? I added below in asp.net but it did not help
<head>
<meta http-equiv="X-Frame-Options" content="allow">
</head>
Please guide, how to allow external website in iframe?
The iframe looks like below:
[iframe mydomain.com/signIn.aspx 640px 400px]
Thanks
You can do it in your web.config (if hosted on IIS 7.0 or later):
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="X-Frame-Options" /> <!-- optional -->
<add name="X-Frame-Options" value="ALLOW" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
This must be added in the application being "framed" (in your case an asp.net app), not in the parent app (wordpress).
Reference: https://www.iis.net/configreference/system.webserver/httpprotocol

Asp.net website compatibility with IE 11

I have an old asp.net intranet website.. I have been using IE 8 till now without any issue. Now I am trying to check if it works well with IE 11. I see that there is no problem with the site when requesting the page from IE 11 from my desktop.
But when I try to debug the same website locally in VS the controls are out of place and even fails to detect the IE Browser by
if(window.ActiveObject) which seems to be correct behaviour for IE 11.
Now I am wondering how the intranet website looks perfectly fine in IE 11. The server is Windows server 2008 IIS 7.
Any suggestion.
The window.ActiveXObject property is hidden from the DOM starting from IE11 so, you can no longer use it.
http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx
In VS, it happens often to see the markup misaligned whenever in designer mode. But I think you should care less about that and focus more on the code markup instead
In the web config file you can use the customHeaders tag:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<httpRedirect enabled="false" />
<httpProtocol>
<customHeaders>
<remove name="X-UA-Compatible" />
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>

TinyMCE Error - content cannot be displayed in an a frame

I have a TinyMCE control on my ASPX.NET page. When the user clicks the "find" button on the control:
The find 'pop-up' appears with the error "This content cannot be displayed in a frame"
The puzzling thing is that for most users, the div/pop-up shows up fine (with the exact same browser version, IE8). Clearing cache and temporary internet files does not appear to resolve the issue.
This item is in the system.webserver node of the web.config
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>
</httpProtocol>
Any ideas on how to resolve this issue? I am unable to reproduce, hitting the same website and performing the same action.
You could try to use the tinymce config parameter dialog_type:
dialog_type: 'modal'
Using modal dialogues the browsers won't have to open new windows.

Setting headers to override IE intranet compatibility mode in ASP.NET

I have an intranet site that loads in IE7 compatibility mode, unless the user has unchecked "Display intranet sites in Compatibility View" on their version of IE8. Unfortunately, the client wants this checked for other sites that they use, so I need to override this setting. I've tried the meta tag,
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
but it does not override the browser setting. However, this question indicates that a server heading will indeed override. This is the example code given in the top answer:
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
I've opened up web.config and put it in <system.webServer> but it doesn't work. I'm watching the headers with fiddler but it isn't adding the header at all. (Also, it still is forced to compatibility mode and Javascript confirms documentMode is 7.) I'm working locally with the ASP.NET Development Server
The <system.webServer> tag is specifically for IIS (7, I believe). It won't affect the Cassini server that Visual Studio uses in-house. If you only need to worry about this issue in a live dev environment, try testing on an instance of IIS. Otherwise, you may want to try IIS Express in development.

Resources