Hey folks,
Having trouble getting the asp:menu to work right on OS X using Safari.
The mouseovers simply do not work, and when you click on one of the links, the menu disappears completely.
I do have some code-behind on the menu for itemCreated (to cause the parent to be highlighted as selected when a child is selected)
Kevin,
This is a known issue. First off, Safari gets served the menu adaptor which is fully functional but does not support the dynamic fly-outs. Instead you must click on menu items to see the sub menus. Secondly, there are some style issues with Safari and
Menu. I've posted on my blog about these issues and potential workarounds:
Thanks for the reply - I actually checked out your blog - it's the only reference to this problem on the net. (and made your first comment!). The problem seems to be if they click on a menu item that should have a dynamic list appear, then the whole menu disappears.
If they click on a menu that doesn't have any sub-menu, it will redirect them fine.
I think I read somewhere, that if we do the downlevel correctly, if they click on a menu item, than it will make the sub-menu pop-up and they can select the sub-link. Am I wrong?
Yes, that is the exact symptoms of the issue I was describing in my blog post. The recommendations I made will help you work around this issue.
--
Danny
disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
I disagree with Danny's work around - there is a much simpler way to get this working.
The asp.net menu control is actually cross browser complaint, and does work correctly on Safari. The problem is how asp.net identify's the browser, and determines the javascript and rendering requirements for it.
Asp.net identify's the browser by comparing it's caps to entries found in the machine.config and web.config. As browsers get updated, these string identifiers change, and so asp.net misreports what browser it is, causing it to render incorrectly on most
browsers. Microsoft have outsourced the updating of browser caps to another company - and that company is not doing anywhere near a decent job at keeping theses up to date.
Good news is that you can set this up yourself by adding entries to the web config. There are plenty of listings available on the net, and I suggest searching Google for "Browser Caps ASP.NET web.config Safari".
Sorry for not being clearer. Safari and IE5.0 are considered downlevel browsers by ASP.NET. By default you won't get rich renderings for either of those. Part of the reason is that for much of the development of ASP.NET, Safari did not support all the
features necessary to render the uplevel menu. What I am trying to help out with in my blog is the issue where you click on a link in the downlevel menu and the menu seems to disappear.
However, all that said, what Doug has mentioned is correct, you can modify browser caps to push try and push a richly rendered menu to Safari. But, be warned, while this
may work for you, it is not a supported scenario and there are a couple of known issues with doing this. Not supported means that any issues you encounter after this modification is up to you to investigate and find
workarounds for. I'm certainly not saying it's a bad idea, if it works for you, that is great and I'd love to know about it.
Future versions of ASP.NET and the Menu control will evaluate what features have become availible in Safari and render appropriately.
--
Danny
disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
I also gave the browsercaps a try but Safari still renders the downlevel menu :(
Would be great if you could post what you have done to make Safari render the menu like IE6 does.
gozoliet
Member
15 Points
5 Posts
Safari browser and asp:menu
Nov 28, 2005 08:02 PM|LINK
Having trouble getting the asp:menu to work right on OS X using Safari.
The mouseovers simply do not work, and when you click on one of the links, the menu disappears completely.
I do have some code-behind on the menu for itemCreated (to cause the parent to be highlighted as selected when a child is selected)
Any ideas?
-Kevin
dannychen
Contributor
4407 Points
840 Posts
Microsoft
Re: Safari browser and asp:menu
Nov 29, 2005 08:50 PM|LINK
This is a known issue. First off, Safari gets served the menu adaptor which is fully functional but does not support the dynamic fly-outs. Instead you must click on menu items to see the sub menus. Secondly, there are some style issues with Safari and Menu. I've posted on my blog about these issues and potential workarounds:
http://weblogs.asp.net/dannychen/archive/2005/11/21/431121.aspx
--
Danny
gozoliet
Member
15 Points
5 Posts
Re: Safari browser and asp:menu
Nov 30, 2005 09:15 PM|LINK
Thanks for the reply - I actually checked out your blog - it's the only reference to this problem on the net. (and made your first comment!). The problem seems to be if they click on a menu item that should have a dynamic list appear, then the whole menu disappears. If they click on a menu that doesn't have any sub-menu, it will redirect them fine.
I think I read somewhere, that if we do the downlevel correctly, if they click on a menu item, than it will make the sub-menu pop-up and they can select the sub-link. Am I wrong?
dannychen
Contributor
4407 Points
840 Posts
Microsoft
Re: Safari browser and asp:menu
Dec 01, 2005 05:42 PM|LINK
--
Danny
sravi
Member
32 Points
7 Posts
Re: Safari browser and asp:menu
Jan 06, 2006 03:18 AM|LINK
Hi Danny,
I tried to do what your blog said. but still I am getting the down-level menu. can you give us a short example which would work on safari?
thank you.
ravi
ResinMC
Member
260 Points
52 Posts
Re: Safari browser and asp:menu
Jan 06, 2006 06:35 AM|LINK
Hi there
I disagree with Danny's work around - there is a much simpler way to get this working.
The asp.net menu control is actually cross browser complaint, and does work correctly on Safari. The problem is how asp.net identify's the browser, and determines the javascript and rendering requirements for it.
Asp.net identify's the browser by comparing it's caps to entries found in the machine.config and web.config. As browsers get updated, these string identifiers change, and so asp.net misreports what browser it is, causing it to render incorrectly on most browsers. Microsoft have outsourced the updating of browser caps to another company - and that company is not doing anywhere near a decent job at keeping theses up to date.
Good news is that you can set this up yourself by adding entries to the web config. There are plenty of listings available on the net, and I suggest searching Google for "Browser Caps ASP.NET web.config Safari".
Hope this helps
Doug
dannychen
Contributor
4407 Points
840 Posts
Microsoft
Re: Safari browser and asp:menu
Jan 06, 2006 05:39 PM|LINK
Sorry for not being clearer. Safari and IE5.0 are considered downlevel browsers by ASP.NET. By default you won't get rich renderings for either of those. Part of the reason is that for much of the development of ASP.NET, Safari did not support all the features necessary to render the uplevel menu. What I am trying to help out with in my blog is the issue where you click on a link in the downlevel menu and the menu seems to disappear.
However, all that said, what Doug has mentioned is correct, you can modify browser caps to push try and push a richly rendered menu to Safari. But, be warned, while this may work for you, it is not a supported scenario and there are a couple of known issues with doing this. Not supported means that any issues you encounter after this modification is up to you to investigate and find workarounds for. I'm certainly not saying it's a bad idea, if it works for you, that is great and I'd love to know about it.
Future versions of ASP.NET and the Menu control will evaluate what features have become availible in Safari and render appropriately.
--
Danny
sravi
Member
32 Points
7 Posts
Re: Safari browser and asp:menu
Jan 08, 2006 08:54 PM|LINK
Hi Doug,
I tried editing the browsercaps and it does not seem to do the trick for me. Have you got is working on safari. Can you post your code please?
ravi
dpomt
Member
46 Points
19 Posts
Re: Safari browser and asp:menu
Jan 16, 2006 08:42 PM|LINK
Hello Doug,
I also gave the browsercaps a try but Safari still renders the downlevel menu :(
Would be great if you could post what you have done to make Safari render the menu like IE6 does.
I have used the following browsercaps:
http://www.codeproject.com/aspnet/browsercaps.asp
and added
<case match="AppleWebKit/412.9">
version="2.0.3"
majorversion="2"
minorversion=".0"
</case>
I have also tried
http://slingfive.com/pages/code/browserCaps/
Dieter
ResinMC
Member
260 Points
52 Posts
Re: Safari browser and asp:menu
Jan 17, 2006 06:27 AM|LINK
Hi Guys
This is what i use for safari:
<case match="AppleWebKit/(?'version'(?'major'\d?)(?'minor'\d{2})(?'letters'\w*)?)">
browser=AppleWebKit
version=${version}
majorversion=0${major}
minorversion=0.${minor}
frames=true
tables=true
cookies=true
javascript=true
javaapplets=true
ecmascriptversion=1.5
w3cdomversion=1.0
css1=true
css2=true
xml=true
tagwriter=System.Web.UI.HtmlTextWriter
<case match="AppleWebKit/(?'version'(?'major'\d)(?'minor'\d+)(?'letters'\w*))(.* )?(?'type'[^/\d]*)/.*( |$)">
type=${type}
</case>
</case>
Cheers