View JSON in Internet Explorer 7-11


Hello guys,

you all know the problem, want to debug an application with IE and IE always wants to download the JSON file.

The other browsers like Chrome or Firefox are doing a better job here.

If you want that IE shows the JSON file without downloading it, here is a registry fix for it.

Create a new text document and insert this (Link:

Windows Registry Editor Version 5.00;
; Tell IE 7,8,9,10,11 to open JSON documents in the browser on Windows XP and later.
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place" .
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]

[HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/json]

Now rename the document to {FileName}.reg and save.

Run it and confirm the dialog.

Now JSON files will be shown directly in IE, without downloading.

*Thanks to Coding 101 from for the Script


Problems in IE11 with compatibility mode?

0x800a01b6 – JavaScript runtime error: Object doesn’t support property or method ‘addEventListener’

Oops, you’re right that was a copy paste error. However I trigger the compatibility mode via the Settings Icon -> Compatibility View Settings -> Add the site in there.

From there on he doesn’t show the div whereas without the comp mode it works without any problems.

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

is set.

“Object doesn’t support this property or method” error in IE11

Best way to solve this until a fix is available (if a fix comes) is to force IE compatibility mode on the user.


<META http-equiv="X-UA-Compatible" content="IE=9>

ideally in the masterpage so all pages in your site get the workaround.

This works, just tested with IE11, I added it to the _Layout.cshtml page –  Manny Mar 27 at 16:37

You can add below code in your web config file for setting document mode:

     <add name="X-UA-Compatible" value="IE=EmulateIE9">

Don’t use runAllManagedModulesForAllRequests=”true” when getting your MVC routing to work

Don’t use runAllManagedModulesForAllRequests=”true” when getting your MVC routing to work

It seems to be common advice to make your modules section of your web.config say <modules runAllManagedModulesForAllRequests="true">. In fact this is quite a drastic thing to do to solve the routing problem and has global effects that could CAUSE ERRORS.

You need a module that goes by the name of UrlRoutingModule-4.0 to be running through IIS. Now, since your MVC URLs are likely to end without .aspx these will not be picked up by IIS and run through the intergrated pipeline and therefore you will end up with 404 not found errors. I struggled with this when I was getting started until I found the <modules runAllManagedModulesForAllRequests="true"> workaround.

This highly recommended fix can cause other problems. These problems come in the form of making all your registered HTTP modules run on every request, not just managed requests (e.g. .aspx). This means modules will run on ever .jpg .gif .css .html .pdf etc.

This is:

  1. a waste of resources if this wasn’t the intended use of your other modules
  2. a potential for errors from new unexpected behaviour.

Better solution

Fine, so the ranting about <modules runAllManagedModulesForAllRequests="true"> is over. What is a better solution?

In the modules section of your web.config, you can add the UrlRoutingModule-4.0 module in with a blank precondition meaning it will run on all requests. You will probably need to remove it first since it is most likely already registered at machine level. So make your web.config look like this:

  <remove name="UrlRoutingModule-4.0" />
  <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
  <!-- any other modules you want to run in MVC e.g. FormsAuthentication, Roles etc. -->

Note: the modules element does NOT contain the runAllManagedModulesForAllRequests=”true” attribute because it is evil!