ASP.NET / C#

Safari Fix for ASP.NET menu control

For web designers/developers using the the ASP.NET menu control you may find that your drop down menu doesn’t work for Macintosh users. Here is a quick fix. Just stick this code snippet in your Page_Load event:

For C# (c sharp)


try
{
    if {Request.UserAgent.IndexOf(”AppleWebKit”) > 0)
    {
       Request.Broswer.Adapters.Clear();
     }
 }
catch
{
}

 

For VB.NET:

'Safari Fix
Try 
      If Request.UserAgent.IndexOf(”AppleWebKit”) > 0 then
        Request.Browser.Adapters.Clear()
     End If
Catch
End Try

Until next time….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s