Monday, 7 May 2012

ASP.Net menu control


ASP.Net menu control not working in Google Chrome


ASP.Net menu controls breaks in Google Chrome and works fine in other browsers. Here is the hack to make it work in Google Chrome as well,
In C#
      if (Request.UserAgent.IndexOf("AppleWebKit") > 0) 
               Request.Browser.Adapters.Clear(); 
In Vb 
             if (Request.UserAgent.IndexOf("AppleWebKit") > 0) Then
                    Request.Browser.Adapters.Clear()
                    Request.Browser.Adapters.Clear()
                End If


Just add this code on your page load and the menu control will start working fine in Google Chrome as well.

No comments:

Post a Comment