ASP.NET Ajax Toolkit Slider handle displays broken image - asp.net

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.

Related

ASP:NET MVC 5 Page Rendering Very Slow

In my asp.net mvc 5 project, every page is rendering very slowly at 5-10 seconds. I've tried many solution to increase performance but I haven't found a solution:
Web Optimization - all scripts and css files bundled
Set to release mode
I've tried ViewEngine clearing and setting one engine (Razor)
I've tried urlCompression
(I haven't tried Etag)
On the Client side, I use ajax but my problem is slow page rendering.
This image shows a page rendered in 6,74 seconds (which is a typical time for other pages)
How can I increase performance for the page rendering, there is no problem on the server side. When I click any link to open a page, I am waiting approx 10 seconds.
I not see all requests. But i fix same problem when i check all errors in request and set this setting (and publish/deploy).
<system.webServer>
<modules>
<add name="BundleModule" type="System.Web.Optimization.BundleModule" />
</modules>
</system.webServer>

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>

Icons missing on Azure Wordpress site

I created a WordPress Azure Website through the Azure Websites Gallery. I installed a theme called Bridge.
Everything is working quite fine...Except, I have no icons appearing on the desktop version of my site (through Chrome, Firefox and IE). I am seeing icons on my Windows phone. I am not seeing icons on the desktop site when I squeeze the window down to mobile phone size.
To give you some background to where this problem is potentially coming from…
I have used a custom domain. To make the WordPress site work with a custom domain, I have added this code to the wp-config.php file:
/*Emma added the below to fix permalink to be custom domain*/
define('WP_HOME','http://examplesite.com');
define('WP_SITEURL','http://examplesite.com);
The code above meant that once you clicked on a post or page and moved away from the homepage, the url was still examplesite.com/pagename instead of examplesite.azurewebsites.net/pagename.
So back to the icon issue…
The icons are displayed through using a font (font-awesome to be exact). I have the latest updates of the theme and the latest 4.2.0 version of the font is in the font files. The font files can be found here in my site:
wp-content > themes > bridge > css > font-awesome > fonts
I asked the Bridge theme team why the icons were not displaying. They replied:
This is happening because of cross-origin access is denied for your site. You should paste this code to htaccess file that is located in
WP installation directory:
<ifModule mod_headers.c>
Header set Access-Control-Allow-Origin: http://examplesite.com
</ifModule>
I do not have an .htaccess file because my site is running on Azure. From what I understand .htaccess files are linked to Apache. Instead of a .htaccess file, I have a web.config file and a web-config.php file because I installed this from Azure.
I created a .htaccess file in the root of my website and pasted the above code. Of course that didn’t work. I also looked up how to write the web.config version of the code and pasted that into the web.config file and that did not work (although with my little knowledge of this area, the syntax is probably wrong) and that didn’t work. See the code below:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="http://examplesite.com" />
</customHeaders>
</httpProtocol>
I also added this to the web.config file and that hasn't worked:
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
I have read that I need to also change the buildAction to "content", but not sure how to do that as when you click properties of files such as .woff, you don't seem to get that option.
I also played around with adding something to the web.config.php file under the custom code I wrote to get my domain to work, but that didn’t work either. Once again, not sure my code was correct.
I went back to the support team at the Bridge theme and they said that I should contact my hosting provider to do this for me because .htaccess can’t work on this type of server.
So, now I am not quite sure what to do.
Does anyone know the correct code I should put into my web.config, web-config.php or other file? Or, is there another issue here I am not understanding? Perhaps something as simple as adding something to the custom css to call to the font?
I wonder if there is a clue in the statement I made above...
"Everything is working quite fine...Except, I have no icons appearing on the desktop version of my site (through Chrome, Firefox and IE). I am seeing icons on my Windows phone. I am not seeing icons on the desktop site when I squeeze the window down to mobile phone size."
If I can see them on my phone, then surely that means at some point the icons are being rendered correctly?
I have had a look through my css files for a change in a way the site is rendered through media queries, but didn't find anything there either.
After many hours of searching for a solution I found this post: Windows Azure CDN and *.woff fonts
I copied this code into my web.config file as a child of system.webserver:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="HEAD,GET,OPTIONS" />
</customHeaders>
</httpProtocol>
That seemed to solve it! :)
Have tested in Chrome, FireFox, IE and mobile and all icons are now showing. Magic!

Internet Explorer compatibility mode

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?

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.

Resources