Using Menu Control - Browser Google Chrome problem

vbkid2010

New member
Joined
Mar 30, 2011
Messages
2
Programming Experience
Beginner
Have noticed this is a common problem, but can't quite figure out the fix I'm looking for. Think I've got the concept, but am maybe slightly off and need a second opinion....



I currently have a Web Page (aspx) with a Static Menu Control.
>There is 1 parent node and 1 child node.


When viewed in Internet Explorer, it works fine.

However, in Google Chrome, it does not work correctly.


To fix this issue, I am currently using the following code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Request.UserAgent.IndexOf("AppleWebKit") > 0 Then
Request.Browser.Adapters.Clear()
Menu1.DynamicMenuStyle.Width = Unit.Pixel(120)
End If

End Sub


However the problem here doing this is that until a PostBack is performed (either by clicking the menu or anything else that exists on the page), this code does not fire and become active.

I have also tried using the above code in a Protected Sub Page_PreRender block, but it has the same effect - a PostBack must be performed before it takes effect.


Therefore this got me thinking, maybe I need to the command Refresh the page after checking the browser version and clearing browser adapters, however then on second thoughts - would this just then get stuck in an endless loop of refreshing?

Thoughts or suggestions anyone?

Am I going about this the correct way?
 
Back
Top