ASP.net在Chrome中无法显示动态菜单的解决方法

1. 工程右键“添加新项”,添加“浏览器文件”,然后会自动生成文件夹App_Browsers,该文件夹下含有一个自动生成的文件BrowserFile.browser,BrowserFile.browser中的内容为:

<!--
可在 <windir>\Microsoft.NET\Framework\<ver>\CONFIG\Browsers 中找到现有的浏览器定义
-->
<browsers>
    <browser id="NewBrowser" parentID="Mozilla">
        <identification>
            <userAgent match="Unique User Agent Regular Expression" />
        </identification>

        <capture>
            <userAgent match="NewBrowser (?'version'\d+\.\d+)" />
        </capture>

        <capabilities>
            <capability name="browser" value="My New Browser" />
            <capability name="version" value="${version}" />
        </capabilities>
    </browser>

    <browser refID="Mozilla">
        <capabilities>
            <capability name="xml" value="true" />
        </capabilities>
    </browser>
</browsers>


2. 在文件夹App_Browsers中增加一个文件Others.browser,内容为:

 <!--
     You can find existing browser definitions at
     <windir>\Microsoft.NET\Framework\<ver>\CONFIG\Browsers
 -->
 <browsers>
     <browser refID="Mozilla">
         <capabilities>
             <capability name="xml" value="true" />
         </capabilities>
     </browser>  

   <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>

 

你可能感兴趣的:(ASP.net在Chrome中无法显示动态菜单的解决方法)