Fix menu in Safari and Chrome

.Net, HTML Add comments

If you use the standard ASP.NET menu (or toolbar) in your web application, it works well in most browsers except for Safari & Chrome. In these 2 browsers, each menu item appears on a new line.

The fix I found was placing the following code in my MaterPage code-behind:
if (Request.UserAgent.IndexOf(“AppleWebKit”) > 0)

If you are not using a Materpage:
protected void Page_PreInit(object sender, EventArgs e)
        if (Request.UserAgent != null && Request.UserAgent.IndexOf(“AppleWebKit”, StringComparer.CurrentCultureIgnoreCase) > -1)
            this.ClientTarget = “uplevel”;

The solution is adapted from this site (Thank you):

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in