Sometime it so happens that the critical functionality, of the Web Applications, works fine on the lower versions than IE 8. Well there is an option provided with IE 8 called Compatibility View which lets user to view the pages in IE 7 style. Compatibility View mode would be OFF by default whenever user browses through the Application in IE 8. In fact Compatibility View button would be visible next to the Address bar clicking on which turns the Compatibility mode ON. I personally do not recommend this option as it seems little overwhelming for user to click on Compatibility View button every time.
To overcome such situations a Meta tag <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> has to be added at very beginning inside the <head> tag. When we add this tag, Compatibility View button itself would not be visible. And at the same time pages would be rendered in IE 7 style. It's not advisable to add meta tag in each and every pages of site, its tedious too. We can add tags, as given below, inside <system.webServer> tag of configuration file to apply Compatibility View for entire site.
<httpProtocol>
<customHeaders>
<clear/>
<add
name="X-UA-Compatible"
value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>
Till now it's fine as long as we are hosting our site on IIS 7. In case we host our site in IIS 6 then the setting that we have added in configuration file will go on toss. This is because IIS 6 understands the tag <system.web> and not <system.webServer>. To overcome this what we can do is add meta tag dynamically into the master page on pre render event. The code for the same is as below.
Page.Header.Controls.AddAt(0, new
HtmlMeta { HttpEquiv = "X-UA-Compatible", Content = "IE=EmulateIE7" });
Well, let me inform you one more thing that the above set above behavior directly though Web server.
Refer http://msdn.microsoft.com/en-us/library/cc817572.aspx for web server IIS.
Refer http://msdn.microsoft.com/en-us/library/cc817573.aspx for web server Apache.
For complete details refer http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx