Thursday, January 05, 2012

ASP.NET Menu Control Cannot Work in Google Chrome browser ?

Posted by Rahul Kharde at 8:50 PM

I am using asp.net menu control which is not working in Google chrome although it is working fine in Firefox and IE.

Here I used the ASP.NET Control Which Contain the 5 Main Menu and 5 Sub menu as Following

<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal"

style="margin-top: 15px">

<Items>

<asp:MenuItem Text="Menu 1" Value="Menu 1">

<asp:MenuItem Text="Sub Menu 1" Value="Sub Menu 1"></asp:MenuItem>

<asp:MenuItem Text="Sub Menu 2" Value="Sub Menu 2"></asp:MenuItem>

</asp:MenuItem>

<asp:MenuItem Text="Menu 2" Value="Menu 2"></asp:MenuItem>

<asp:MenuItem Text="Menu 3" Value="Menu 3"></asp:MenuItem>

<asp:MenuItem Text="Menu 4" Value="Menu 4">

<asp:MenuItem Text="Sub Menu 1" Value="Sub Menu 1"></asp:MenuItem>

<asp:MenuItem Text="Sub Menu 2" Value="Sub Menu 2"></asp:MenuItem>

<asp:MenuItem Text="Sub Menu 3" Value="Sub Menu 3"></asp:MenuItem>

</asp:MenuItem>

<asp:MenuItem Text="Menu 5" Value="Menu 5"></asp:MenuItem>

</Items>

</asp:Menu>

When I run this on Google Chrome not working

Solution

Put this code in Page_Load method it will sort the issue.

if (Request.UserAgent.IndexOf("AppleWebKit") > 0)

{

Request.Browser.Adapters.Clear();

}



If you enjoyed this post and wish to be informed whenever a new post is published, then make sure you subscribe to my regular Email Updates. Subscribe Now!


Kindly Bookmark and Share it:

YOUR ADSENSE CODE GOES HERE

0 comments:

Have any question? Feel Free To Post Below:

 

Popular Posts

Recent Comments

© 2011. All Rights Reserved | Help to understand .Net | Template by Blogger Widgets

Home | About | Top