I need to have my ASP.NET web application support both 8 and prior versions of the IE browser. However, when I click the "broken page" button on my IE8 address bar to switch to Compatibilty View, menu background images are cropped, there is a vertical gap between two menus and a gap between my asp:menu bar and a navigation user control above it.
Regular IE8 view:
Compatibility View:
The general format of each menu is:
<asp:TableCell ID="tcFurnMenuSectls" runat="server">
<asp:Menu ID="menuFurnSectls" runat="server" StaticDisplayLevels="1" MaximumDynamicDisplayLevels="1"
Orientation="Horizontal"
CssClass="FurnMenuSectionals" StaticMenuItemStyle-ItemSpacing="0px"
DynamicMenuItemStyle-CssClass="FurnMenuDynamicItem"
StaticMenuItemStyle-CssClass="FurnMenuStaticItem"
DynamicHoverStyle-CssClass="FurnMenuDynamicItemHover"
DynamicVerticalOffset="0"
StaticHoverStyle-CssClass="FurnMenuStaticItemHoverSectls"
StaticEnableDefaultPopOutImage="false"
DynamicPopOutImageUrl="~/Images/AppMenu/menu_arrow_grey.gif" DynamicMenuItemStyle-VerticalPadding="2"
DisappearAfter="0" OnMenuItemClick="menuFurn_MenuItemClick">
<Items>
<asp:MenuItem Text="Sectionals " ImageUrl="~/Images/AppMenu/FurnMenuGradientTransparent.png" Selectable="false">
<asp:MenuItem Text="Options "
Value="Sectionals_Options" NavigateUrl="~/FurnMain.aspx?_page=OptsSectl&_title=SectionalOptions">
</asp:MenuItem>
<asp:MenuItem
Text="Latest deals "
Value="Sectionals_Deals"
NavigateUrl="~/FurnMain.aspx?_page=DealsSectl&_title=SectionalDeals"></asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>
</asp:TableCell>
If I select View -> Source, save the generated HTML and compare the two results, the only difference is in a property of the upper ("Client Home") user control:
<table id="topNavCtrl_menuTopNav" class="TopNavMenu topNavCtrl_menuTopNav_2" cellpadding="0" cellspacing="0" border="0" style="margin-top:-2px;">
In the "compatibility" version, margin-top is -3px, instead of -2.