asp:menu fix for IE8 problem available

(c) 2003 Bertrand Le Roy Internet Explorer 8 is a unique release in the history of Internet Explorer in more than one way, but the decision to make standards mode the default means that authors of existing sites are impacted by it, if only to set the compatibility mode to IE7.

But what if your site is built using components that render out markup and script over which you have little control, such as ASP.NET WebControls? Well, if one of the controls fails in IE8 standards mode, you need to either switch to compatibility mode (ouch!) or you need the component developer to ship an updated version.

During the whole IE8 development cycle, we monitored the behavior of existing controls. Most ASP.NET built-in controls have been doing just fine in IE8, or the faulty behavior was actually due to an IE bug that we reported and that got fixed.

All except asp:menu. It so happens that the menu control is making a bad assumption on what the default value for z-index should be. We debated this at length with the IE team, but it became clear as we did so that they were right and that we were wrong. We had to fix that.

So here it is, the patch for menu is out and you can apply it to build IE8-compatible ASP.NET WebForms sites…

Windows 2000, XP, Server 2003:
http://code.msdn.microsoft.com/KB962351/Release/ProjectReleases.aspx?ReleaseId=2294

Windows Vista, Server 2008:
http://code.msdn.microsoft.com/KB967535/Release/ProjectReleases.aspx?ReleaseId=2328

UPDATE: the KB article can now be found here:
http://support.microsoft.com/kb/962351

87 Comments

  • Are these the right ones?

    KB962351 - WebBaseEvent.Raise fails in the Application_Start event on IIS 7.0

    KB967535 - IIS 7.0 Request.TransmitFile / Request.WriteFile not working expected

  • those links point to IIS 7 patches? is that right ? i would have thought these would have been for the CLR or something similar?

  • Yes, these are the right patches. I know the titles are a little off, but these patches do contain the menu fix.

  • If anyone is intersted, there is also a simple CSS fix for this issue. All you need to do is set the z-index of the dynamic popouts. I blogged about it here if anyone wants additional details:

    http://weblogs.asp.net/mhildreth/archive/2009/01/26/testing.aspx

  • Ok, so it takes exactly 3 days to get a fix for rendering issues in YOUR browser, but rendering issues in Safari have NEVER been fixed since .NET 2.0

    Microsoft, always the same company: evil empire

  • Will this fix eventually make it to a windows update ?

  • How can KB 962351 be a patch for Windows 2000, XP and Windows Server 2003, when the patch is tagged as a fix for IIS 7.0 ?

    None of those OS's can run IIS 7.0.

  • @Mike: believe me, it took a lot longer than 3 days... And please don't shoot the messenger. What Safari issue are you referring to exactly?

    @mcbeev: probably not, but the fix is in 4.0 already.

    @Juan: there is more than one patch in the download.

  • Just a quick question. This patch is backward compatible for IE7 and IE6 correct?

  • Our sites are pre-compiled will the sites have to be re-pre-compiled after we apply the patch?

    Tom B

  • to have the asp:menu work in all other browsers (where it is NOT working by default), simply add:

    Context.Request.Browser.Adapters.Clear() ' vb.net

    to your login or master page.

    i wrote scott guthrie months ago about this, explaining to him that the asp:menu control has become an 'orphan' when we found this problem in Win 7 beta (and that I didn't think adequate resources where being allocated for cross-browser compatibility in general).

    sadly, when i use to know SG as a development manager, he use to write back (or Rob Howard who is long gone as well).

    rob k

  • It works perfectly. thanks

  • Non-related question, sorry:

    There seems to be no easy way to submit IE8 feedback / bug report :( https://connect.microsoft.com/IE/feedback page is displayed until you login with Windows Live account, but cannot be found after login... very unfriendly environment.

    I'm aware of two bugs / non-standard behaviors, one lasts since IE6 or even 5:
    1) Incorrect behavior of window.onblur event under IE and a workaround http://pro-thoughts.blogspot.com/2006/10/incorrect-behavior-of-windowonblur.html
    2) Internet Explorer Global Variable Blow ups http://www.west-wind.com/Weblog/posts/677442.aspx

  • @vkelman: I don't work on the IE team, but I think those bugs are known. I also tried the connect page and it works fine for me, on Chrome at least. You might want to give it another shot.

  • @Bertrand,
    https://connect.microsoft.com/IE/feedback works... until you login to Windows Live, after a login it breaks. Thanks anyway.

  • @vkelman: I can't reproduce that problem. You can report it the the Connect team on this page: https://connect.microsoft.com/Main/help/emailsupport.aspx?Category=3

  • Worked great. I think it's funny that microsoft didn't test their program and controls with their new ie release.

  • @Erik: of course we did. That's why we're able to provide the patch the same week IE8 goes RTM. It also enabled us to find and report many IE bugs to the IE team over the last year.

  • I tried this on two different IIS 6/Win2k3 installs, it didn't work on either of them. It just says something about 'none of the products that are addressed by this software update are installed on this computer', even though they most definitely are.

  • @Matt: apparently you didn't have SP1 installed on those machines. Is that correct?

  • @Armando: please check you have 3.5 SP1 installed.

  • Please make sure that 2.0 SP2 is installed on the machine.

    If you have more issues, you can contact hongli at Microsoft.

  • It's not work for me.. )-;
    ?????????????????????????

  • Hmm, won't install on Win7 RC.

  • @John: You should contact support about that. My guess would be that the RTM of Win7 will have the fix built-in.

  • I've installed the path, it fixed some of the problems. Now I've got one wierd problem. I've got a masterpage that has a menu control.

    When I browse to a page that has very few controls(like my login.aspx page) hover effects and popout menus are lightening quick(as soon as you move your mouse, it reacts). I can switch back and forth to compatibility mode and its the same speed either way.

    Then I go to a page that has a gridview with 40 lines in it. Suddenly the hover effects on the menu control take 1-3 seconds to respond when I mouseover/mouseout on them. If I switch to compatibility mode, back to the same speed as my login page. Only IE8, works as expected on FireFox, Chrome, and Safari.

    Its driving my customers and I nuts.

  • Hi There,

    For me just applying the CSS fix din't help. Instead I had to install the hotfix as well as the css fix.

    Now it works as expected. Thanks for the article!

    Regards,
    TP

  • Hi,

    Thanks for the article and the hotfix.

    Works fine now :-D

    Regards,

    Jose

  • my css fix didnt work either, installing hotfix tonight..

  • Works great. This has been driving me crazy.

    Thanks for you help.

    Stephen

  • IE explorer have siply messed up my whole website beacuse it is CSS based.

    I have a hard time applying styles to my ASP:Menu.
    1. Hpw do you set the distance between your vertical menuitems?
    2. How do you set the distance between the dynamic popouts?
    /Stine

  • The hotfix works, sortof. I now see the menu items however, the verticle spacing is off making the menu items overlap each other. :(

  • @elvstine: in your case, I'd recommend using the CSS adapters (until ASP.NET 4.0 comes out and makes the menu CSS friendly once and for all). They can be found here: http://www.asp.net/cssadapters/

    @Matthew: that's weird. I'd probably contact support for that. Or contact me at bleroy at microsoft.

  • I just found out about this bug today when a client of mine installed IE8. Had to download the IETester virtual hard drive and install UtilDev Cassini, but eventually got a test environment up where I could debug without deploying to a remote server.

    This client site is hosted at DiscountASP.NET, and a support ticket yielded the reply: "We are actually waiting for a rollup fix that includes this issue. We are aware of the hotfix however there is an issue that is preventing us from applying it to all the servers. While I dont have the exact details, I can tell you that as soon as the rollup fix is available we will install it." from Mike O @ DiscountASP.NET.

    As it turns out, the fix was rather easy without any changes to the server. It took me about as long to download the IE8 VHD as it did to solve the rendering issues. Aside from specifying the z-index for the DynamicMenuStyle CssClass, I also had to explicity set StaticSubMenuIndent="0px" on the Menu control itself (default of 16 pixels was causing problems in some static menu items). The only other change needed was an explicit height for a div defined inside a StaticItemTemplate for the Menu.

    Bertrand you rock... but I do have to second the notion of fixing Safari problems, mainly the AJAX framework's detection of AppleWebKit -- you know what I mean ;)

    -Dan Ludwig

  • Just Dandy! ..It worked .. Great post

  • Can't install hotfix on Vista SP2? Says update is not for machine...

  • @evgeni: sorry but that is a bad idea. By removing the doctype, you're switching the browser into quirks mode, and all kinds of stuff will start breaking unpredictably. You will also enter a whole new world of pain getting your code to look consistent cross-browser.

  • Bertrand: of course is not good idea but as a qick fix may work.
    Other option is to replace it with


    which is slightly older standard

  • I just came across this issue today when a customer phoned me about their menus appearing white. Thanks for the info !
    While investigating it here I noticed that on IE8 on my laptop it works fine but I am not logged in as administrator.
    When logged in as a local admin or as a domain admin it gives me a white popup menu. However when logged in as a local user account it works normally. I tested this on 4 computers and got the same results on all of them.
    The CSS fix alone hasnt solved the problem for me i still get the white menu setting the z-index to 100.

  • @Daniel: that may be a security trimming problem in the site map. You can make sure by trying other navigation controls such as treeview or sitemappath.

  • Using @mhildreth css fix and @Rob Karatzas Vb code on the page load....

    Now I am having asp:menu that works in all new browser(IE8, Firefox3, Chrome3, Safari4)

    Thanks guys that really helped me a lot.....

  • I applied this KB 962351 and it solved the menu problem until now. I have a ASP.NET 3.5 Web site.
    My XP computers with IE 8 and latest updates/patches view the menu fine but my Vista Ultimate comptuers with SP2 and all of the latest automatic updates/patches as of 5 Aug 2009 now have blank text for the sub menu items.
    If I force the IE 7 compatibility mode then it works correctly.
    When they applied the Visual Studio emergency update last week did they break the System.UI.WebControls.Menu control? I would prefer to run in IE 8 mode so please let me know when they fix it again for Vista Computers with IE 8 so I can continue to run just in IE 8 mode, which is what I prefer.

  • @Dale: I don't know. I would suggest you contact support to get an answer to that. Contact me at bleroy at microsoft if you don't know how.

  • Bertrand,
    I'm experiencing the same result as Dale. Can you post a solution, if one is available. Thanks.

  • Bertrand,
    I contacted support and after a few days they posted that the problem was resolved when they hadn't done anything to resolve it. I gave them a unsatisfactory review on their satisfaction survey. I don't think they understood my problem entirely and closed it as an easy way out.

  • @Dale: I would reopen the incident. That is not right.

  • I am using the Windows server 2003 and would like to fix this problem now. However, when I use http://code.msdn.microsoft.com/KB962351/Release/ProjectReleases.aspx?ReleaseId=2294 ,
    I get "The specified release was not found."

    When I go to http://support.microsoft.com/kb/962351

    it lets me go to 969612 hyperlink. When I go to this page, it lets me go back to 962351 hyperlink .

    What is wrong?

    Does anyone have a patch for Server 2003? Please give a direct hyperlink so that I can download it.

    Moreover, Hong Li at Microsoft, after I download and install the .net 2.0 sp2, the problem is still there.

    Thanks a lot. Now this problem is urgent for me.

  • These fixes still do not correct the border-style issues seen in ie8, correct?

    I implemented the z-index with the hotfix and the menus are working correctly, but my panel border styles (groove, inset, outset, etc) have all gone to solid.

    Any idea on how to resolve that?

  • @petersga: I don't know. Does it work outside of the menu?

  • Border-style issues are a known bug in IE8. Groove, inset, outset, etc are not currently supported in IE8, only work when Compatibility mode is turned on.

    I have several panels in the main body of my page, all set with border-style of groove. When compatibility is turned off they all show as solid borders. With it on they show up as groove.

    When I implement the z-index style and hotfix, the blank menu items issue goes away, but the border-style issues do not.

    Is there any fix for the border-style issues in IE8 yet?

  • @petersga: the hotfix is patching ASP.NET, not IE. You'd have to ask someone from IE, I suppose.

  • i tried to apply this patch to the Windows SBS 2003 and doesnt works, any special patch for this OS ?

    thanks

  • @Fran: I don't know. You should contact support.

  • @gummadi sri ramulu: if tweaking your CSS doesn't work, please contact support.

  • I downloaded and install it to Windows 2008, but still the same thing. The asp:menu works fine in IE7 but in IE8 the asp:menu not work well the same as before installation of the patch.

  • @Schubert: if you're still seeing problem after applying this patch, please contact support.

  • Hi
    The links to the patches dont work.
    My Menu has 2 problems.
    #1 background turns white for no reason
    #2 some filler space is added above the titles for no reason
    the problem is only in 1.1 strict doctype. i don not want to go backwards to 1.0 or transitional
    the problems are only in ie8 and only from my hosting company (on my local machine its fine. in FF its always fine.
    so where do i get whichever patches that i need, and how do iget them to my hosting company. are they iis patches? or windows? or can i put them in my bin folder?
    thanks

  • @Yisman: yes they do, and they should lead you to this: http://code.msdn.microsoft.com/KB969612, which is the patch those updates were rolled into. Please follow the instructions that come with the patches to install.
    For any problems not solved by these patches, please contact support.
    Note that 1.1 strict has never been supported though.


  • evgeni said:

    Remove this from your .aspx



    And menu starts working. (at least for me)


    Baskar said: Thanks evgeni its working fine






  • i am facing the browser compatibility with asp.net menu control. menus are well working with IE6 but with IE8 and like chrome menus are not working properly.

  • @narenda: what kind of problem are you seeing? What doctype are you using? Did you apply any custom styles?

  • Bertrand Le Roy:
    In IE8 the text of root menus are displayed but the text of child menus are not displayed. and in google chrome the root as well as child menus are not displayed. It totally get disturbed. I have applied autoformat provided by microsoft

  • @narenda: what about the doctype? If you are using a supported doctype, then you should contact support.

  • i am using original doctype thst asp.net uses.
    but if i remove that doctype and add following code then it works.

    Context.Request.Browser.Adapter.Clear() 'vb.net

    Is this way fine to use?

  • It is posible to display submenu using

    remove your old !DOCTYPE

    and add insted of <body

  • Please stop advocating removing the DOCTYPE: bad, bad bad idea.

  • Hi, I dont want to apply the patch as I suspect many of my users to the site will not have. So I need to make sure it's going to work in a non-fixed version of IE8. (does this make sense?)

    So I set the Z index to 100 and that solves the IE8 issue.

    It has always worked in FF but not in Chrome.

    Any idea why setting the z index does not fix the Chrome issue?

  • @Scott: this is a *server* patch. Your users don't need to be patched. This is *not* patching IE, it's patching ASP.NET.

  • using code betwin tag head

  • Much appreciate on your posting.
    At the first, I thought my code is not correct when use the menu control.

    This site is very helpful to resolve this problem.
    I wish more info can be available on asp.net.

    Cheers~!!

  • Thanks Rob for fixing the problem.

    Now my site menu works in all browsers.

    Context.Request.Browser.Adapters.Clear();

    Cheers.

  • @segue: my name's not Rob, but you're welcome.



  • Is Good Idea . Working Fine.
    Thanks
    Iranian Programmers

  • works fine, thanks ramin.

  • Roy,
    The link provided: code.msdn.microsoft.com/KB969612 will open a new page where there are 5 tabs (Home, Downloads, Discussions, People, License) but on download one it says: This Resource has no releases.
    On Home tab, there are no instructions on how to apply the fix either.

    Doesn't look very professional to me...

    Any solutions?

  • @Ed: errr. "The hotfix that corresponds to KB969612 has been superseded with the hotfix KB981201, which contains all fixes that were previously included in KB969612. You should use the hotfix KB981201 to fix the issues described in KB969612."
    Alternatively, you can upgrade to a more recent version of ASP.NET.

  • How to get the hotfix hotfix 981201

  • @Caesar: call support.

  • @ ramin

    Thanks, now submenu has no compatibility issue, its working with all other brower

    Thanks, Thanks A LOT..

  • Thanks mauli and chetali
    It works fine

    remove your old !DOCTYPE

    and add insted of <body

  • I have created a application using menu control in asp.net 2.0, and it is not running in IE8 vertion but it easily running in mozilla browser.
    Have you any idea about this?

  • @sankayan: upgrade?

  • hi i had tried with both of the version but the only problem is that the menu is aligned in left side in place of the centrer of the screen

  • @Herman: contact support.

  • Gee, @idanciu, that problem has been patched in 2009, as this post shows. If the version of ASP.NET you are running today still has this problem, it's time to upgrade, not to apply workarounds...

  • I had a calendar control with an apparent negative z-index and removing
    Fixed the issue.

    To all those making blanket statements about this being a "bad bad bad" idea remember that things are rarely black and white.
    In an enterprise intranet environment where all users' PCs are forced to be a certain version this works just fine.

  • Please let me explain again why this is a bad bad bad idea: by switching to quirks mode, you are going to break other things in unpredictable ways. It's cargo-cult programming. If you want to go there, fine, knock yourself out, but don't advise other people do the same. There are rational and good fixes for these issues that should be used instead.

Comments have been disabled for this content.