title: Asp.Net MVC 4 login page returns json instead of view
body: <p>I'm building a Asp.Net MVC 4 application and I use the built-in login/register functionality. When I input wrong user name and password Chrome send me a page with html code instead of error messages. When I tried the same in IE it returns json document and ask me to save it. I have not changed the code of the Login action method. What could cause this?</p>
  
  <p>edit:</p>
  
  <p>It's enabled. I have that key in my web.config. This is the generated HTML of the login page:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;title&gt;Log in&lt;/title&gt;
  &lt;link href="/favicon.png" rel="shortcut icon" type="image/x-icon" /&gt;
  &lt;link href="/Content/styles/flexslider.css" rel="stylesheet" /&gt;
  &lt;link href="/Content/styles/prettyPhoto.css" rel="stylesheet" /&gt;
  &lt;link href="/Content/styles/style.css" rel="stylesheet" /&gt;
  
  &lt;link href="/Content/themes/custom/jquery-ui-1.10.3.custom.css" rel="stylesheet" /&gt;
  
  
  &lt;script src="/Scripts/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script src="/Scripts/portfolio-filter.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/all-in-one.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/setup.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/main.js"&gt;&lt;/script&gt;
  
  &lt;script src="/Scripts/jquery-ui-1.10.3.custom.js"&gt;&lt;/script&gt;
  
  &lt;script src="/Scripts/jquery.unobtrusive-ajax.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.validate.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.validate.unobtrusive.js"&gt;&lt;/script&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;header class="header_bg clearfix"&gt;
      &lt;div class="container clearfix"&gt;
  
          &lt;div class="span2"&gt;
  
              &lt;div&gt;
                  &lt;ul class="social-links"&gt;
                      &lt;li&gt;&lt;a href="https://www.facebook.com/pages/Balkancar-Record-JSC/151365561578329?fref=ts" target="_blank"&gt;
                          &lt;img src="/Content/images/facebook.png" alt="Facebook" /&gt;&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="javascript:"&gt;
                          &lt;img src="/Content/images/twitter.png" width="24" height="24" alt="Twitter" /&gt;&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
  
  
              &lt;div class="lang-switch"&gt;
                  &lt;a href="#"&gt;English&lt;/a&gt;
                  &lt;ul&gt;
                      &lt;li&gt;
                          &lt;a href="/SetCulture/bg-BG?currentUrl=http%3A%2F%2Flocalhost%3A2487%2FAccount%2FLogin" id="bg-BG"&gt;Български&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li&gt;
                          &lt;a href="/SetCulture/en-US?currentUrl=http%3A%2F%2Flocalhost%3A2487%2FAccount%2FLogin" id="en-US"&gt;English&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li&gt;
                          &lt;a href="/SetCulture/ru-RU?currentUrl=http%3A%2F%2Flocalhost%3A2487%2FAccount%2FLogin" id="ru-RU"&gt;Руский&lt;/a&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
  
              &lt;section id="login"&gt;
  
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="/Account/Register" id="registerLink"&gt;Register&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Account/Login" id="loginLink"&gt;Log in&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
  
              &lt;/section&gt;
  
              &lt;div class="logo"&gt;
                  &lt;a href="/"&gt;
                      &lt;img src="/Content/themes/base/images/BalkancarLogo.png" alt="Balkancar Record Co"
                          title="Balkancar Record Co" /&gt;
                  &lt;/a&gt;
              &lt;/div&gt;
  
  
  
              &lt;nav class="main-menu"&gt;
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/About"&gt;About us&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;a href="/Home/History"&gt;History&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Products/Products"&gt;Products&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;a href="/Products/Forklifts"&gt;Forklifts&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="/Products/Electro"&gt;Electro&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="/Products/TowTractors"&gt;Tow tractors&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="/Products/ElectricPlatforms"&gt;Electric platforms&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/Sertificates"&gt;Sertificates&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/Announcements"&gt;Announcements&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/Dealers"&gt;Dealers&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/Contact"&gt;Contacts&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;a href="/Home/RequestQuote"&gt;Request a quote&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="/Home/Departments"&gt;Departments&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="/Home/Map"&gt;Map&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/nav&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/header&gt;
  &lt;div class="clear"&gt;&lt;/div&gt;
  
  &lt;section class="container clearfix"&gt;
      &lt;header class="container page_info clearfix"&gt;
          &lt;h1 class="regular bottom_line"&gt;Log in.&lt;/h1&gt;
          &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;/header&gt;
  
      &lt;div class="col_1_2"&gt;
          &lt;h2&gt;Use a local account to log in.&lt;/h2&gt;
          &lt;form action="/Account/Login" method="post"&gt;
              &lt;input name="__RequestVerificationToken" type="hidden" value="pCU9vwbREtMyY-pBCdJqeu-af1sZwVrX6-LEIfKvoZIHr59qkwp_voncWYJaWyaKUGGJCVWObvG85aG9mEMvn1kjRT2RnOpY-9mI4XzDtq81" /&gt;&lt;div class="validation-summary-errors"&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Wrong user name or password.&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;&lt;/legend&gt;
                  &lt;p&gt;
                      &lt;label for="UserName"&gt;User name&lt;/label&gt;
                      &lt;input data-val="true" data-val-required="The User name field is required." id="UserName" name="UserName" type="text" value="jhg" /&gt;
                      &lt;span class="field-validation-valid" data-valmsg-for="UserName" data-valmsg-replace="true"&gt;&lt;/span&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                      &lt;label for="Password"&gt;Password&lt;/label&gt;
                      &lt;input data-val="true" data-val-required="The Password field is required." id="Password" name="Password" type="password" /&gt;
                      &lt;span class="field-validation-valid" data-valmsg-for="Password" data-valmsg-replace="true"&gt;&lt;/span&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                      &lt;input data-val="true" data-val-required="The Remember me? field is required." id="RememberMe" name="RememberMe" type="checkbox" value="true" /&gt;&lt;input name="RememberMe" type="hidden" value="false" /&gt;
                      &lt;label class="checkbox" for="RememberMe"&gt;Remember me?&lt;/label&gt;
                  &lt;/p&gt;
                  &lt;input type="submit" value="Log in" /&gt;
              &lt;/fieldset&gt;
              &lt;p&gt;
                  &lt;a href="/Account/Register"&gt;Register&lt;/a&gt; if you don&amp;#39;t have an account.
              &lt;/p&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  
      &lt;div class="col_1_2 last"&gt;
          &lt;section class="social" id="socialLoginForm"&gt;
              &lt;h2&gt;Use another service to log in.&lt;/h2&gt;
              &lt;form action="/Account/ExternalLogin?ReturnUrl=" method="post"&gt;
                  &lt;input name="__RequestVerificationToken" type="hidden" value="DRqkpbBT0xarOTdJjZ6NAOcZaPP9Xxx4_jOPeNhLFPGbOxxWEoxDx4NmN2lx4WxgZbYNe4VRBekPakyoXj6AmWKuW2XUV1yW5KC7QBpTMpQ1" /&gt;
                  &lt;fieldset id="socialLoginList"&gt;
                      &lt;legend&gt;Log in using another service&lt;/legend&gt;
                      &lt;p&gt;
                          &lt;button type="submit" name="provider" value="google" title="Log in using your Google account"&gt;Google&lt;/button&gt;
                      &lt;/p&gt;
                  &lt;/fieldset&gt;
              &lt;/form&gt;
          &lt;/section&gt;
      &lt;/div&gt;
  
  &lt;/section&gt;
  
  &lt;div class="clear padding10"&gt;&lt;/div&gt;
  &lt;section class="homepage_widgets_bg clearfix"&gt;
      &lt;div class="container clearfix"&gt;
          &lt;div class="padding20"&gt;&lt;/div&gt;
  
          &lt;div class="col_1_3"&gt;
              &lt;h1 class="regular white bottom_line"&gt;Contacts&lt;/h1&gt;
              &lt;p id="contacts"&gt;
                  &amp;quot;Balkancar Record&amp;quot; Co&lt;br /&gt;
                  17 &amp;#39;&amp;#39;Kuklensko Shosse&amp;#39;&amp;#39; str.&lt;br /&gt;
                  4004 Plovdiv&lt;br /&gt;
                  Phone: +359/32/ 69 50 50&lt;br /&gt;
                  Fax: +359/32/ 69 27 53&lt;br /&gt;
                  E-mail: &lt;a href="mailto:record@balkancar-record.com"&gt;record@balkancar-record.com&lt;/a&gt;
              &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class="col_1_3"&gt;
              &lt;h1 class="regular white bottom_line"&gt;Follow us&lt;/h1&gt;
              &lt;a href="https://www.facebook.com/pages/Balkancar-Record-JSC/151365561578329?ref=ts&amp;fref=ts" target="_blank"&gt;
                  &lt;img src="/Content/themes/base/images/facebook.png" alt="Facebook" /&gt;
              &lt;/a&gt;
              &lt;a href="http://www.youtube.com/user/BalkancarRecordJSC/videos" target="_blank"&gt;
                  &lt;img src="/Content/themes/base/images/youtube.png" alt="YouTube" /&gt;
              &lt;/a&gt;
  
              &lt;script type="text/javascript"&gt;
                  window.___gcfg = {
                      lang: 'en-US'
                  };
  
                  (function () {
                      var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                      po.src = 'https://apis.google.com/js/plusone.js';
                      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
                  })();
              &lt;/script&gt;
              &lt;br /&gt;
          &lt;/div&gt;
          &lt;div class="col_1_3 last" id="why-section"&gt;
              &lt;h1 class="regular white bottom_line"&gt;Subscribe&lt;/h1&gt;
              {"Message":"Please fill in both fields!"}                
          &lt;/div&gt;
          &lt;div class="padding80"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;footer class="footer_bg_bottom clearfix"&gt;
      &lt;div class="footer_bottom container"&gt;
          &lt;div class="col_footer"&gt;
              &lt;div class="menu"&gt;
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/About"&gt;About us&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Products/Products"&gt;Products&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/Sertificates"&gt;Sertificates&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/Announcements"&gt;Announcements&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/Dealers"&gt;Dealers&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Home/Contact"&gt;Contacts&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
              &lt;div class="clear padding20"&gt;&lt;/div&gt;
              &lt;p&gt;&amp;copy; 2013 &amp;quot;Balkancar Record&amp;quot; Co&lt;/p&gt;
              &lt;p&gt;Build version: 1.0.1408.805&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class="clear padding20"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/footer&gt;
  
  &lt;script src="/Scripts/jquery.unobtrusive-ajax.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.validate.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/jquery.validate.unobtrusive.js"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>