I am working on SharePoint 2010 and I want to use
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
for a specific page.
The master page is setting it to "IE=8" which doesn't allow me to use box-shadow in CSS e.g.
I don't have access to the masterpage to change it. Also I have read that changing that meta in master page is not recommended as it might cause issues with other things like calendars or whatever.
So my Q is: is there any way of overwriting the X-UA-Compatible meta tag in a simple page (.aspx)?
If you can edit the master page and only want to change the compatibility for particular pages you can take a similar approach to buli (thanks) but overwrite the existing Content of the meta tag. For your meta tag in the master page, give it an id and runat server
In your page load, find the control from master, cast to HtmlMeta and change the Content
Among the ways to change the compatibility mode for page two of them seems promising:
X-UA-compatible
HTTP header: The web server has requested a legacy document mode via an HTTP header.X-UA-compatible
meta tag: The webpage developer used a meta tag to specify a legacy document mode.SharePoint 2010's default master page hardcodes
X-UA-Compatible
meta tag, and meta tag takes precedence over HTTP header, so this can't be done on HTTP level. This leaves us with the second option.It seems that the first
X-UA-compatible
meta tag encountered on the page is used by IE (although it's ambiguous in different articles and missing in MSDN documentation). If you write SharePoint UserControl or WebPart you might add this code e.g. inPage_Load()
method to add this header as the first one:where
HtmlMeta
comes fromSystem.Web.UI.WebControls
namespace.By iterating through
Page.Header.Controls
you could probably also find and remove the meta tag added by default by SharePoint, although the code above seems enough to trigger Edge mode in IE11.