Click here to Skip to main content
12,759,704 members (32,623 online)
Click here to Skip to main content
Add your own
alternative version


4 bookmarked
Posted 11 Oct 2013

Rendering of dynamic items of Asp Menu control

, 26 Feb 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
Asp Menu controls lacks to render its items which are set with dynamic visibility in Internet Explorer 8. Microsoft has also confirmed at Microsoft

Editorial Note

This articles was originally at but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

Asp Menu controls lacks to render its items which are set with dynamic visibility in Internet Explorer 8. Microsoft has also confirmed at Microsoft Support that this particular issue resides in some of their products [1]. After a systematic testing Microsoft has found that IE is not faulty for this, but the asp menu control surely is [2]. The issue happens because the asp menu control assumes the value of CSS property z-index wrongly for its dynamic items. The control works as expected with other browsers like IE-7, IE-6, Firefox and others.

There are a few workarounds for this problem;


Microsoft Hotfix for Asp Menu control problem

Soon after the release of IE-8, this bug was reported and Microsoft released a Hotfix to address this issue. This is available for both Windows XP and Windows Vista.

The Knowledge Base for this Hotfix can be found here;

The Hotfix itself can be downloaded from these locations;


This Hotfix although is available for applications built in Framework 2.0. For the later Frameworks the Knowledge Base (KB981201) suggests to contact Microsoft Support to obtain this HotFix.

Overriding the z-index property for dynamic items

As the problem is due to bad z-index assumption, we can set the z-index of dynamic items as a highest value than all control’s z-index. This solves the problem for the asp menu control and the given z-index value is used.

To achieve this solution, add a CSS class for the z-index of asp menu dynamic items, in the CSS file


Use this CSS class as the DynamicMenuStyle-CssClass for the asp menu control, in the skin file


<%-- some other properties --%>


<%-- some other properties --%>


This workaround is very good, as we do not need to compromise on any browser or control level functionality. Moreover, using this technique does not incorporate any external resources.


Emulating IE-7 in IE-8

IE-6 and IE-7 does not bother asp menu control for the rendering of its dynamic items. So, an alternate solution is to add a Meta tag for emulating IE-7 in IE-8. This also, fixes the problem.

To achieve this solution, add a Meta tag at the page level for emulating IE-7

<html xmlns="">
<head id="Head1" runat="server">
    <%--Emulating IE-7--%>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title>Untitled Page</title>
    <form id="form1" runat="server">
        <asp:Menu ID="Menu1" runat="server" >
            <%-- some properties --%>

This Meta tag can also be added at the application level in web.config file

            <clear />
            <add name="X-UA-Compatible" value="IE=EmulateIE7" />

Using CSS Friendly Control Adapters

CSS friendly adapters have been set up according to the HTML and XHTML standards. These render many asp controls (Menu, TreeView, DetailsView etc) as per the standards, thus lessening the controls rendering and browser compatibility issues.

To achieve this solution [3]

  • Download the CSS Friendly Adapters assembly and browser file from codeplex from
  • Add a reference to this assembly in your project.
  • Add the App_Browsers folder and put the adapter’s browser file there.

This way the CSS adapter will work to render the controls in a correct manner. CSS Friendly Adapters are good when one wants to build a site as per the standards and want to keep it standard compliant for the new browsers also, but using these adapters also lessen the performance particularly in the rendering phase of a page.

Another noticeable point is that currently the CSS friendly adapters can be used with ASP.NET 2.0 only. The new version is in the development process although.


Solution for Other Browsers

IE-8 has now been made the highest standards compliant browser (100%). But the other browsers still are running non-compliant. Firefox 3 is 90%, whereas Opera 9 is 85% standards compliant [4]. The ratio for Chrome and Safari is not perfect too.

Asp menu control happens to be faulty in some of these browsers as well, like Safari on top.

The solution to this problem in the browsers like Chrome and Safari can be achieved by clearing the control adapters (as in Page_Load event) or rendering the page as the previous browsers (as in Page_PreInit event)

protected void Page_Load(object sender, EventArgs e)
   if (Request.UserAgent.Contains("AppleWebKit"))

protected void Page_PreInit(object sender, EventArgs e)
   if (Request.UserAgent.Contains("Safari"))
       Page.ClientTarget = "uplevel";


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

ASP.NET Community
United States United States
The ASP.NET Wiki was started by Scott Hanselman in February of 2008. The idea is that folks spend a lot of time trolling the blogs, googlinglive-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.

The ASP.NET Wiki articles moved to CodeProject in October 2013 and will live on, loved, protected and updated by the community.
Group type: Collaborative Group

769 members

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 26 Feb 2014
Article Copyright 2013 by ASP.NET Community
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid