Michaelvoo - This one gets written in ink in my "big book of tricks" for browser compatibility fixes. That was an awesome find that just solved Mac display issues on four sites for me. Thanks a googol!
BTW, I tested for the Safari 1.3 crash problem you described, but using Safari 3.0.3, and it doesn't seem to be a problem any longer. Static and dynamic menus dropped down on a horizontal menu, and on a different site the vertical .NET menu rendered just
as well without a problem.
Personally, changing the ClientTarget to "uplevel" is not a good fix for me.
The ASP.Net menu control renders correctly on Safari; however, I noticed that HttpBrowserCapabilities now thinks the browser is
IE5.
I have an "AlphaImage" control I'm using to display all of my alpha–transparent
PNG images. If the control detects
IE5 it dynamically swaps out the img reference for a div with an
IE–only filter at runtime.
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
If InStr(Request.ServerVariables("http_user_agent"), "Safari") Then
Page.ClientTarget = "uplevel"
End If
End Sub
Also for those who are using a StaticPopOutImageUrl and are experiencing a Spacing issue with Firefox and Safari, use a CssClass for the StaticMenuItemStyle for padding (Don't use the StaticMenuItemStyle's HorizontalPadding property)
But we had more problems than just menus so using the uplevel settings as shown below fixed ALL issues. Never any more complaints.
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
'Test for Safari or any other browser that is not recognized properly by ASP.NET 2.0
If InStrRequest.ServerVariables("http_user_agent"), "Safari") > 0 Then
Session("SetToUpLevelBrowser") = True
Else
Session("SetToUpLevelBrowser") = False
End If
End Sub
In every page put......
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
If Session("SetToUpLevelBrowser") Then
Page.ClientTarget = "uplevel"
End If
End Sub
darwaish
Member
21 Points
41 Posts
Re: Safari browser and asp:menu
Jul 04, 2007 07:46 AM|LINK
This one worked for me.
http://www.big-o.org/?p=20
lexx_Debug
Member
34 Points
10 Posts
Re: Safari browser and asp:menu
Aug 12, 2007 03:35 PM|LINK
thanks a million time bro!, that solved all my issues.
cheers
Rodashar
Member
602 Points
133 Posts
Re: Safari browser and asp:menu
Aug 13, 2007 09:02 PM|LINK
Awesome man that works perfect.... now If I can just fix the white space between my images :P
dazimmermann
Member
9 Points
3 Posts
Re: Safari browser and asp:menu
Sep 19, 2007 10:44 PM|LINK
Michaelvoo - This one gets written in ink in my "big book of tricks" for browser compatibility fixes. That was an awesome find that just solved Mac display issues on four sites for me. Thanks a googol!
BTW, I tested for the Safari 1.3 crash problem you described, but using Safari 3.0.3, and it doesn't seem to be a problem any longer. Static and dynamic menus dropped down on a horizontal menu, and on a different site the vertical .NET menu rendered just as well without a problem.
ASP .NET menu Safari display problem
ejstembler
Member
102 Points
29 Posts
Re: Safari browser and asp:menu
Oct 01, 2007 06:10 AM|LINK
Personally, changing the ClientTarget to "uplevel" is not a good fix for me.
The ASP.Net menu control renders correctly on Safari; however, I noticed that HttpBrowserCapabilities now thinks the browser is IE5.
I have an "AlphaImage" control I'm using to display all of my alpha–transparent PNG images. If the control detects IE5 it dynamically swaps out the img reference for a div with an IE–only filter at runtime.
Of course, since Safari does not support Microsoft's proprietary filters the PNGs do not show up.
nandhucbm
Member
21 Points
57 Posts
Re: Safari browser and asp:menu
Oct 17, 2007 09:40 AM|LINK
Thanks craigbtx.
It is working fine for me.
developerJam...
Member
264 Points
61 Posts
Re: Safari browser and asp:menu
Jan 14, 2008 12:02 PM|LINK
Thanks, michielvoo.... Adding the safari.browser file to the App_Browsers folder with this is what solved my problem.
------------------------------------------------------------------------------------------
<browsers>
<browser refID="safari1plus">
<controlAdapters>
<adapter controlType="System.Web.UI.WebControls.Menu" adapterType="" />
</controlAdapters>
</browser>
</browsers>
------------------------------------------------------------------------------
Also for those who are using a StaticPopOutImageUrl and are experiencing a Spacing issue with Firefox and Safari, use a CssClass for the StaticMenuItemStyle for padding (Don't use the StaticMenuItemStyle's HorizontalPadding property)
<StaticMenuItemStyle CssClass="staticMenuItem" />
---------------------------------------------------------------------------
SimonRigby
Member
87 Points
56 Posts
Re: Safari browser and asp:menu
Feb 15, 2008 10:49 AM|LINK
craigbtx
Participant
1702 Points
896 Posts
Re: Safari browser and asp:menu
Feb 15, 2008 02:44 PM|LINK
I'll have to try this, looks simple.
But we had more problems than just menus so using the uplevel settings as shown below fixed ALL issues. Never any more complaints.
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
'Test for Safari or any other browser that is not recognized properly by ASP.NET 2.0
If InStrRequest.ServerVariables("http_user_agent"), "Safari") > 0 Then
Session("SetToUpLevelBrowser") = True
Else
Session("SetToUpLevelBrowser") = False
End If
End Sub
In every page put......
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
If Session("SetToUpLevelBrowser") Then
Page.ClientTarget = "uplevel"
End If
End Sub
soros
Member
2 Points
1 Post
Re: Safari browser and asp:menu
Apr 16, 2008 01:12 AM|LINK