ASp.net 3.5中的菜单控件在谷歌浏览器中无法正常工作 [英] Menu Control in ASp.net 3.5 is not working properly in google chrome

查看:119
本文介绍了ASp.net 3.5中的菜单控件在谷歌浏览器中无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,我的菜单列表中的控件在asp.net 3.5中无法正常使用Google Chrome





请帮帮我朋友我紧急







hi friends my menu list Control in asp.net 3.5 is not working properly in google chrome


please help me friends am in urgent



.menu_style
        {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            color: #000000;
            border: 1px solid #C8B678;
            color: #806000;
            background-color: #FFF7DD;
           
        }
        .menuStylehover
        {
            color: #EEEBE6;
            border: 1px Solid #C8B678;
            background-color: #A47E00;
           
            text-decoration: none;
        }













<asp:Menu ID="Menu1" StaticMenuItemStyle-CssClass="menu_style" StaticHoverStyle-CssClass="menuStylehover"

                    DynamicHoverStyle-CssClass="menuStylehover" DynamicMenuItemStyle-CssClass="menu_style"

                    runat="server" Height="88px" Width="266px" style="margin: 10px auto;">
                    <staticmenuitemstyle cssclass="menu_style"></staticmenuitemstyle>
                    <dynamichoverstyle cssclass="menuStylehover"></dynamichoverstyle>
                    <dynamicmenuitemstyle cssclass="menu_style"></dynamicmenuitemstyle>
                    <staticitemtemplate>
                        <%# Eval("Text") %>
                        <asp:Label runat="server" ID="lbItmCount">[<%#Eval("ChildItems.Count")%>]
                    </staticitemtemplate>
                    <statichoverstyle cssclass="menuStylehover"></statichoverstyle>

推荐答案

要解决此问题,您需要告诉.net浏览器的功能。对于.net 2.0&上面你需要创建一个具有这些功能的新浏览器文件并将其上传到你的服务器。



在VS2008解决方案资源管理器中右键单击你的应用程序并添加ASP.Net文件夹App_Browsers,如果你还没有它。

添加一个新的浏览器文件项目到这个特殊文件夹并称之为safari.browser(如果修复Chrome的问题)

删除VS中放入此文件的所有默认内容,并将其替换为以下内容:

< browsers>

< browser refid =safari1plus>

< controladapters>

< adapter controltype =System.Web.UI.WebControls.Menuadaptertype =>







保存文件&在本地进行测试以确定是否一切正常。

现在为烦人的一点。上传新的app_browser文件夹&文件到您的生产服务器,如果您使用复制网站菜单选项上传或分享点或首页,这些将在app_browsers下创建一个名为vti_cnf的新文件夹

手动删除app_browser下的vti_cnf文件夹在您的生产服务器上。如果你不这样做,你会得到解析错误:根级别的数据无效。第1行,位置1.在新的safari.browser文件中。

每次更改app_browser文件夹或包含文件时,请记住手动删除此vti_cnf文件夹。

所以你去了,如何解决谷歌Chrome控制渲染问题。







http:// fabenterprises .wordpress.com / 2009/03/21 / aspnet-menu-not-rendering-correct-in-googles-chrome / [ ^ ]
To solve this you will need to tell .net the capabilities of the browser. For .net 2.0 & above you need to create a new browers file with the capabilities and upload it to your server.

In VS2008 Solution Explorer right click your application and add the "ASP.Net Folder" App_Browsers if you don’t already have it.
Add a New "Browser File" item to this special folder and call it safari.browser (if fixing the problem for Chrome)
Delete all the default stuff VS put in this file and replace it with the following:
<browsers>
<browser refid="safari1plus">
<controladapters>
<adapter controltype="System.Web.UI.WebControls.Menu" adaptertype="">



Save your file & test locally to see if all is well.
Now for the annoying bit. Upload the new app_browser folder & file to your production server, if you have used the "copy web site" menu option to upload or sharepoint or frontpage, these will create a new folder under app_browsers called vti_cnf
Manually delete the vti_cnf folder under app_browser on your production server. If you don’t you’ll get "Parse error: Data at the root level is invalid. Line 1, position 1." in your new safari.browser file.
Remember to manually delete this vti_cnf folder everytime you make a change to the app_browser folder or contained files.
So there you go, how to solve the control rendering problems with Google’s Chrome.



http://fabenterprises.wordpress.com/2009/03/21/aspnet-menu-not-rendering-correctly-in-googles-chrome/[^]


这篇关于ASp.net 3.5中的菜单控件在谷歌浏览器中无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆