ASP:Menu in IE8

Since a few days I have installed Internet Explorer 8 on my computer and I was curious how it would display certain sites. Till a few hours ago everything looked nice.

When navigating to an internet site we had just developed for one of our clients I noticed a strange thing. On the default page we added a custom control that inherits from the ASP Menu. The hover of that menu wasn’t working anymore in IE8.

After searching on Google I found an solution for this problem ( here ) and I also found another possible solution (here tanks to Mark Hildreth’s). The problem is caused by IE8 because it does not handle the z-index off the page right. You can fix this problem by doing the following:

Create a new class in your CSS file or place it in your web page:

 .aspmenufix
 {
     z-index: 1;
 }

In the ASP menu control you have to add the following:

<asp:Menu ID="Menu1" runat="server">
    <DynamicMenuStyle CssClass="aspmenufix" />
</asp:Menu>

I hope this will help everyone who uses the ASP Menu in his website!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.