Solve the problems caused by the setting of the client's IE browser & quot; Compatibility View & quot;

Source: Internet
Author: User

When I recently developed an ASP. NET web Report for the customer, I found that it is always strange to view webpages on the customer's IE 8 browser.

After investigation, we found that the customer's IE 8 browser was set to "use Compatibility View for local network. (The customer's company has a windows domain and normal users cannot change many windows configurations ).

 

After careful analysis, since all users on the client side are IE8, there is no need to use the IE8 compatibility mode to simulate IE6.

The customer's company may use this configuration to make the old Web system developed/debugged Based on ie6.

Now we are developing new software. All users use IE8 and there is no need to consider the compatibility of IE6. We only need to tell the customer's browser to use IE8 standard mode.

 

I tried to add

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

<Meta http-equiv = "X-UA-Compatible" content = "IE = 8"/>

All of the above are invalid.

 

After checking google, we found that in the background Code, setting the response Header "X-UA-Compatible" parameter can work properly:

Public class TestHander: IHttpHandler {public void ProcessRequest (HttpContext context) {HttpResponse res = context. response; // for compatibility view setttings in IE8, res is useful for any settings. addHeader ("X-UA-Compatible", "IE = 8 ");...}...}

Take notes to avoid forgetting and sharing with them.

 

------------- Reprinted please indicate the source: http://www.cnblogs.com/jacklondon

------------- Welcome to download the trial of the Single Sign-on system, http://zheguisoft.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.