My dotnetnuke website looks fine in IE9 but breaks in IE8 & IE7.
I've tried the meta tag :
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
but if i put it in the ascx ( 1st line ) but it doesnt show up. And if i put it in the page setting - tags , it shows up at the bottom of the header. So it also doesnt work that way, how to get the tag on top or is there any other way?
Thanks in advance.
You can use some code to add the directive. In your skin (or, in a control that is references by each skin control), add the following:
<script runat="server">
private void Page_PreRender(object sender, EventArgs e)
{
var meta = new HtmlMeta();
meta.Content = "IE=edge";
meta.HttpEquiv = "X-UA-Compatible";
this.Page.Header.Controls.AddAt(0, meta);
}
</script>
This requires that AutoEventWireup
is true in the Control directive. Otherwise you'll also need to override OnInit
or something like it to manually wire up the event.