我怎样才能得到在 Safari 中工作?

发布于 2024-07-06 13:01:58 字数 66 浏览 7 评论 0原文

在 safari 浏览器上,标准的根本渲染不好。 如何解决这个问题?

On the safari browser, the standard <asp:Menu> doesn't render well at all. How can this be fixed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

此生挚爱伱 2024-07-13 13:01:58

感谢您的建议,它引导我找到了以下解决方案;

我创建了一个名为“safari.browser”的文件并将其放置在 App_Browsers 目录中。 该文件的内容如下所示;

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

据我了解,这告诉 ASP.NET 不要使用通常用来呈现控件内容的适配器,而是使用上层呈现。

Thanks for the advice, it led me into the following solution;

I created a file named "safari.browser" and placed it in the App_Browsers directory. The content of this file is shown below;

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

As I understand it, this tells ASP.NET not to use the adaptor it would normally use to render the control content and instead use uplevel rendering.

面如桃花 2024-07-13 13:01:58

您可以使用 ControlAdapter 来更改服务器控件的呈现。

这是一个例子:
http://www.pluralsight.com/ Community/blogs/fritz/archive/2007/03/27/46598.aspx

不过,在我看来,放弃菜单控件而采用纯 css 控件(在许多网站上都有)可能是等量的工作。

You can use ControlAdapters to alter the rendering of server controls.

Here's an example:
http://www.pluralsight.com/community/blogs/fritz/archive/2007/03/27/46598.aspx

Though, in my opinion it might be equal amount of work to abandon the menu control for a pure css one (available on many sites).

桃扇骨 2024-07-13 13:01:58

Oooof - 希望这将是一个在 web.config 中添加具有适当值或类似值的 browserCaps 项的简单情况...

Oooof - was hoping it would be a simmple case of adding a browserCaps item in web.config with appropriate values or similar...

标点 2024-07-13 13:01:58

我找到的解决此问题的最佳和最简单的解决方案是将这段代码包含在 page_load 事件中。

if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
    Request.Browser.Adapters.Clear();

The best and simplest solution I've found for this problem is to include this bit of code in your page_load event.

if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
    Request.Browser.Adapters.Clear();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文