Compatibility problems with Internet Explorer 10/11 and an old .net framework 1.1 website

别等时光非礼了梦想. 提交于 2019-12-06 00:40:46

edit the web.config file and in the <system.web> section add

    <browserCaps>
        <case match="IE[ /](?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*))">
            browser=IE
            version=${version}
            majorversion=${major}
            minorversion=${minor}
            frames=true
            tables=true
            cookies=true
            javascript=true
    javaapplets=true
            activexcontrols=true
            ecmascriptversion=1.5
            vbscript=true
            backgroundsounds=true
            isMobileDevice="true"
            <filter match="[4-9]" with="${major}">
                ecmascriptversion=1.3
                css1=true
                css2=true
                xml=true
                <filter match="[5-9]" with="${major}">
                    w3cdomversion=1.0
                </filter>
              </filter>
              <filter match="^b" with="${letters}">
               beta=true
            </filter>                                                               
         </case></browserCaps>

First: The X-UA-Compatible tag has to be the very first tag in the < head > section.

Try using the emulate option, which allows quirks mode:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

Also, completely removing a "DOCTYPE" from your page has also been known to help force compatibility mode or putting something like an xml declaration at the top

<?xml version="1.0" encoding="UTF-8">

just try to configure the IIS for this -

Add the custom HTTP response header in IIS

To add a custom HTTP response header at the Web site level, at the folder level, or at the virtual directory level in IIS, follow the steps for the version of IIS that you are using.

IIS 7 on a Windows Server 2008-based Web server

  1. Start IIS Manager. To do this, click Start, click Run, type inetmgr, and then click OK.
  2. Under Connections, double-click the server that you want, and then double-click Sites.
  3. Click the Web site, the folder, or the virtual directory where you want to add the custom HTTP response header.
  4. Under Home, double-click HTTP Response Headers in the IIS section. Note The placeholder refers to the name of the Web site.
  5. Under Actions, click Add.
  6. In the Name box, type X-UA-Compatible.
  7. In the Value box, type IE=EmulateIE7.
  8. Click OK.

IIS 6 and earlier versions

  1. Click Start, click Run, type inetmgr.exe in the Open box, and then click OK.
  2. Expand the server that you want, and then expand Web Sites.
  3. Right-click the Web site, the folder, or the virtual directory that you want, and then click Properties.
  4. On the HTTP Headers tab, click Add under Custom HTTP headers.
  5. In the Custom header name box, type X-UA-Compatible.
  6. In the Custom header valuebox, type IE=EmulateIE7.
  7. Click OK two times.

for more detail please see this link

I managed to find a solution: basically I retarget my application to run under Framework 4.0 while the application is still compiled with Framework 1.1.

To accomplish this I followed this MSDN page. Here's an excerpt:

You can retarget the application to run under .NET Framework 4. Retargeting requires that you add a element to the application's configuration file that allows it to run under .NET Framework 4. Such a configuration file takes the following form:

<configuration> 
   <startup>
      <supportedRuntime version="v4.0"/>
   </startup>
</configuration>

So my problem is solved in 2 steps:

  1. add this section to the web.config file of the Framework 1.1 web application:

    <configuration> 
       <startup>
          <supportedRuntime version="v4.0"/>
       </startup>
    </configuration>
    
  2. in IIS create a new application Pool and configure the old Framework 1.1 web application to run with Framework 4.0 in the newly created pool

Now the application runs under Framework 4.0 therefore new browsers are correctly recognized and advanced features are available.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!