asp.net menu control not rending correctly in safari

后端 未结 9 1005
没有蜡笔的小新
没有蜡笔的小新 2020-12-31 17:56

The site I\'m working on is using a Databound asp:Menu control. When sending 1 menu item it renders HTML that is absolutely correct in Firefox (and IE), but really messed u

9条回答
  •  滥情空心
    2020-12-31 18:47

    Here's the easiest way to fix this issue for both chrome and safari if you have multiple web apps:

    Create a file named safari.browser in "%SystemRoot%\Microsoft.NET\Framework[version]\CONFIG\Browsers" that contains the following:

    
        
            
                
            
        
    
    

    This will tell asp.net not to use an adapter when rendering the menu control for safari. Safari1Plus is defined at the end of the mozilla.browser file in the same directory. This works for chrome as well because they both use webkit which is how asp.net identifies Safari1Plus.

    Next run %SystemRoot%\Microsoft.NET\Framework[version]\aspnet_regbrowsers -i

    this will compile all the browser files into an assembly and add it to the GAC.

    now the asp.net menu will render correctly in safari and chrome.

    Alternatively you can add the file the the App_Browsers directory in each of your web apps.

提交回复
热议问题