1

I am doing the following meta tag to force the page to run in IE9

<META http-equiv="X-UA-Compatible" content="IE=9">

However, based on my research, it appears the following is causing the meta tag above not to work (here is the link that describes why):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

There is a solution in PHP but I am not certain if I can run the code. My question is: Is their an alternative solution that does not involve PHP? Can it be done in VB?

user9808783
  • 129
  • 11

1 Answers1

1

Please bear in mind that support for IE9 ended on January 12, 2016; also: What does <meta http-equiv=“X-UA-Compatible” content=“IE=edge”> do?

You can use IIS to add the header: How to add a custom HTTP response header to a Web site that is hosted by IIS.

You can use a setting in web.config to add the header.

In the VB.NET, you can use HttpResponse.AppendHeader:

Protected Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
    Response.AddHeader("X-UA-Compatible", "IE=EmulateIE7")
End Sub
Andrew Morton
  • 24,203
  • 9
  • 60
  • 84
  • @ Andrew: I tried the approach that was provided, within the header tags "" and it throws an 500 Internal Server Error – user9808783 Oct 03 '18 at 17:54
  • @user9808783 The code snippet I showed is intended to be used in a code-behind file. Are you trying to put your code in the .aspx file instead of the .aspx.vb file? – Andrew Morton Oct 03 '18 at 17:56
  • @user9808783 OK, you should be able to press F7 to get to the code-behind file. Put the code just before the line `End Class`. Remember to build the solution. – Andrew Morton Oct 03 '18 at 18:03