Works Only on Postback, not on first page load

Aug 6, 2012 at 6:53 PM

I am using the adapters at legacyfundraiser.com and easysonglicensing.com.

In Chrome, it works, but only after a page reload. For example if I search my sites on Google and click the search result to go to the site, the asp.net menu I use apparently has no CSS style at all attached to it. If I reload the page by refreshing, or clicking any link, it looks good.

I am using the following vb.net code in my master page. When I try removing this code, no CSS appears at all, even on a refresh. Any ideas?

 

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

        Dim temp As String = Request.UserAgent.ToLower
        If temp.Contains("applewebkit") Or temp.Contains("safari") Or temp.Contains("chrome") Then
            Request.Browser.Adapters.Clear()
        End If

        Dim j As String = Page.Request.ServerVariables("http_user_agent").ToLower()
        If j.Contains("safari") Or j.Contains("chrome") Then
            Page.ClientTarget = "uplevel"
        End If

    End Sub