title: Override X-UA-Compatible setting in web.config for specific pages and frames
body: <p>I have a .Net web application that includes a web.config setting to force Internet Explorer to turn off compatibility mode and use the most recent version of IE available:</p>
  
  <pre><code>&lt;system.webServer&gt;
    &lt;httpProtocol&gt;
      &lt;customHeaders&gt;
        &lt;add name="X-UA-Compatible" value="IE=Edge" /&gt;
      &lt;/customHeaders&gt;
    &lt;/httpProtocol&gt;
  &lt;/system.webServer&gt;
  </code></pre>
  
  <p>However, this application contains a legacy page that requires Compatibility mode.  In my testing, it will only display properly when <code>X-UA-Compatible</code> is set to <code>IE=5</code>.</p>
  
  <p><strong>Is there a way to override the web.config setting for a single page?</strong></p>
  
  <p>Among the many things I have tried that have not worked:</p>
  
  <ul>
  <li>Including <code>&lt;meta http-equiv="X-UA-Compatible" content="IE=5" /&gt;</code> on the page itself, as the first tag after <code>&lt;head&gt;</code></li>
  <li>Adding <code>X-UA-Compatible:IE=5</code> to the response headers.  Unfortunately, it also sends the <code>X-UA-Compatible:IE=Edge</code> header, and that one 'wins.'</li>
  <li>Changing the <code>&lt;!DOCTYPE &gt;</code>.  I tried all the various options.</li>
  <li>Adding a comment before the DOCTYPE</li>
  <li>Re-writing the page to be standards-compliant.  This is obviously the best solution, but the page in question is a complex mapping application, and the re-write is going to take several months.</li>
  </ul>
  
  <p><strong>Update</strong><br>
  When I called this "a complex mapping application," I should have said "a rat's nest of frames and tables."  It turns out that the frames part was relevant to the solution.</p>