一、代码中设置兼容性
<summary> 兼容性视图 </summary> <param name="myPage"></param> <remarks></remarks> Public Shared Sub SetHeadCompatible(ByRef myPage As Page) Dim li As Literal = New Literal() li.Text = "<meta http-equiv=""X-UA-Compatible"" content=""IE=EmulateIE7""/> " myPage.Header.Controls.AddAt(0, li) End Sub
二、在web Config中设置兼容性
<system.webServer> <!-- IE7以上兼容性设置 --> <httpProtocol> <customHeaders> <clear/> <add name="X-UA-Compatible" value="IE=EmulateIE7"/> </customHeaders> </httpProtocol> </system.webServer>