解决Google Chrom不兼容ASP.NET Menu控件的问题

方案一:

 在ASP.NET项目中添加Others.browser文件

内容如下:

<!--
可在 
< windir > \Microsoft.NET\Framework\ < ver > \CONFIG\Browsers 中找到现有的浏览器定义
-->
< browsers >
  
< browser id = " Safari3 "  parentID = " Safari1Plus " >
    
< identification >
      
< userAgent match = " Safari/\d+\.\d+ "   />
    
</ identification >
    
< capture >
      
< userAgent match = " Version/(?'version'\d+\.\d+) "   />
    
</ capture >
    
< capabilities >
      
< capability name = " browser "  value = " Safari3 "   />
      
< capability name = " version "  value = " ${version} "   />
    
</ capabilities >
    
< controlAdapters >
      
< adapter controlType = " System.Web.UI.WebControls.Menu "
               adapterType
= ""   />
    
</ controlAdapters >
  
</ browser >
  
< browser id = " GoogleChrome "  parentID = " Safari3 " >
    
< identification >
      
< userAgent match = " Chrome/(?'version'\d+\.\d+) "   />
    
</ identification >
    
< capabilities >
      
< capability name = " browser "  value = " Googlebot "   />
    
</ capabilities >
  
</ browser >
</ browsers >

方案二: 

设置Menu控件的DynamicMenuItemStyle的CssClass属性, 设置 css z-index:1 就可以了!重新打开页面就没问题了,IE8中也没问题的。

你可能感兴趣的:(asp.net)