Skip Navigation Links
Home
About Me
Interests
Cool Stuff
Off Site
Contact Me
Sitemap

Google Chrome & my dropdown menu
So I finally figured out what was going wrong with my drop-down menu in Google Chrome. It's actually something I figured out a long time ago after having the same issue with Safari, which both use the WebKit browser engine. Basically you need to say that this is an "uplevel" browser so it can render the HTML properly. Here it is:

Public Sub Page_PreInit(ByVal s As Object, ByVal e As EventArgs)
   If InStr(Request.ServerVariables("http_user_agent"), "Safari") Then
      Page.ClientTarget = "uplevel"
   End If
End Sub

Place this code in your codebehind page or however you want just so long as it runs on the pages you need it to. On PreInit it will check if the user is using safari/chrome and mark that it's an 'uplevel' browser and can handle the asp.net menu control.

That's it. Enjoy!
Comments (0) posted on 11-21-2008 at 6:37 PM

News


Dates to Remember



Copyright © 2004-2012 Joshua Church. All rights reserved.