Microsoft Visual Studio – ASP.Net Dynamic and Static Hover Style Conflict in IE-9 Browser

When working with a menu control, I found that Internet Explorer 9 can’t handle setting both the static and dynamic hover style properties of the menu control. It works fine in Chrome and Firefox, but not IE-9.

To make IE-9 compatible, add the following meta tag within your <head> tag of your aspx page that contains the menu control.

<meta http-equiv=”X-UA-Compatible” content=”IE=9″/>

<%@ Page Language="VB" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
 <title>Menu Server Control</title>
 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
</head>
<body>
 <form id="form1" runat="server">
 <asp:SiteMapDataSource ID="SiteMapDataSource1" Runat="server" />
 <asp:Menu ID="Menu1" Runat="server" DataSourceID="SiteMapDataSource1">
 <StaticHoverStyle BackColor="Green" BorderColor="Black" BorderStyle="Solid" 
 BorderWidth="5"></StaticHoverStyle>
 <DynamicHoverStyle BackColor="DarkGray" BorderColor="Black" BorderStyle="Solid" 
 BorderWidth="1"></DynamicHoverStyle> 
 </asp:Menu>
 </form>
</body>
</html>

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *