简体   繁体   English

如何使用“ X-UA兼容”与母版页隔离一页

[英]How to isolate one page using “X-UA-Compatible” from Master Page

I have an application with a master page. 我有一个带有主页的应用程序。 The page inherits the master page. 该页面继承了母版页。 Prior to IE9, we had no issues in regards to our image viewer. 在IE9之前,我们在图像查看器方面没有任何问题。 After some research, I have found that I need to use the "X-UA-Compatible" in the meta tag. 经过研究,我发现我需要在meta标签中使用“ X-UA-Compatible”。 However, this issue is only occurring on one page. 但是,此问题仅发生在一页上。

If I put <meta http-equiv="X-UA-Compatible" content="IE=8" /> in the master page, the problem is solved, but that means the rest of the application will have to use this as well. 如果我将<meta http-equiv="X-UA-Compatible" content="IE=8" />放在母版页中,问题就解决了,但这意味着应用程序的其余部分也必须使用它。 Is there a way for a single page to use that meta tag without effecting the rest of the application? 有没有一种方法可以使单个页面使用该meta标签而不影响应用程序的其余部分?

Thanks for any input. 感谢您的任何投入。

There are many ways, eg: 有很多方法,例如:

  1. put the Response.AppendHeader("X-UA-Compatible", "IE=8"); Response.AppendHeader("X-UA-Compatible", "IE=8"); to the codebehind of that single page 到那一页的代码背后
  2. Put a placeholder to your masterpage and fill it with the meta tag only on that single page 将占位符放到您的母版页上,并仅在该单个页面上用meta标签填充它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM