views:

206

answers:

4

So I'm using a Menu control on my page, and it has dynamic items that should drop down when you hover over a menu item. This works in all browsers except for Safari 4.0.3.

I've looked around and there seem to be several solutions to this problem:

  1. Add this code to the Page_Load event:
    if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
    {
        Request.Browser.Adapters.Clear();
    }
  1. Add this code to the Page_PreInit event:

    if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
    {
        this.ClientTarget = "uplevel";
    }
  2. Add a browser file like in this thread: Link to thread

Well I've tried all of those, and none of them seem to work.

I should mention that this did use to work in older versions of Safari using option #2. But it's not working for me with the newest version of Safari.

Does anyone know how to fix this?

A: 

have you tried adding ClientTarget="uplevel" in the actual @Page directive?

Mark Redman
Yes, that didn't fix it either.
A: 

Have you tried using the CSSAdapters version of the Menu? It produces much cleaner, semantic HTML and should be easier to style, too.

Dan Diplo
A: 

I'm working on the same project as Steven. Yes, we have tried adding ClientTarget="uplevel" in the actual @Page directive. We didn't see any difference in Safari's behavior.

Janae
A: 

Try this in your .browser file:

<browsers>
    <browser refID="Safari">
        <controlAdapters>
           <adapter controlType="System.Web.UI.WebControls.Menu" adapterType="" />
        </controlAdapters>
    </browser>
</browsers>

(from the top of my head, so exact syntax might be wrong)

The key is <browser refID="Safari">.

mxmissile