Tales from the Evil Empire

Bertrand Le Roy's blog

News


Bertrand Le Roy

BoudinFatal's Gamercard

Tales from the Evil Empire - Blogged

Blogs I read

My other stuff

Archives

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

Comments

Lucas said:

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

# March 23, 2009 7:42 PM

mike johnson said:

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

# March 23, 2009 7:46 PM

Bertrand Le Roy said:

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

# March 23, 2009 7:50 PM

mhildreth said:

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:

weblogs.asp.net/.../testing.aspx

# March 23, 2009 8:09 PM

Mike said:

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

# March 24, 2009 8:25 AM

mcbeev said:

Will this fix eventually make it to a windows update ?

# March 24, 2009 8:45 AM

Juan T. Llibre said:

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.

# March 24, 2009 1:09 PM

Bertrand Le Roy said:

@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.

# March 24, 2009 4:29 PM

tfbarrett1981 said:

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

# March 25, 2009 9:03 AM

tfbarrett1981 said:

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

Tom B

# March 25, 2009 9:40 AM

Rob Karatzas said:

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

# March 25, 2009 12:27 PM

Jarid said:

It works perfectly. thanks

# March 31, 2009 1:20 PM

vkelman said:

Non-related question, sorry:

There seems to be no easy way to submit IE8 feedback / bug report :( connect.microsoft.com/.../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 pro-thoughts.blogspot.com/.../incorrect-behavior-of-windowonblur.html

2) Internet Explorer Global Variable Blow ups www.west-wind.com/.../677442.aspx

# April 2, 2009 12:22 PM

Bertrand Le Roy said:

@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.

# April 2, 2009 12:37 PM

vkelman said:

@Bertrand,

connect.microsoft.com/.../feedback works... until you login to Windows Live, after a login it breaks. Thanks anyway.

# April 2, 2009 2:21 PM

Bertrand Le Roy said:

@vkelman: I can't reproduce that problem. You can report it the the Connect team on this page: connect.microsoft.com/.../emailsupport.aspx

# April 2, 2009 7:41 PM

Erik said:

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

# April 3, 2009 11:50 AM

Bertrand Le Roy said:

@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.

# April 3, 2009 12:32 PM

Matt said:

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.

# April 3, 2009 4:40 PM

Bertrand Le Roy said:

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

# April 3, 2009 7:13 PM

Bertrand Le Roy said:

@Armando: please check you have 3.5 SP1 installed.

# April 6, 2009 1:56 PM

Hong Li said:

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

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

# April 6, 2009 4:57 PM

Masoud said:

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

?????????????????????????

# April 11, 2009 4:23 PM

John Walker said:

Hmm, won't install on Win7 RC.

# May 4, 2009 12:38 AM

Bertrand Le Roy said:

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

# May 4, 2009 1:31 AM

NXTwothou said:

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.

# May 15, 2009 3:04 PM

tp said:

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

# May 20, 2009 6:28 PM

Jose said:

Hi,

Thanks for the article and the hotfix.

Works fine now :-D

Regards,

Jose

# June 4, 2009 3:59 AM

Martin said:

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

# June 14, 2009 11:54 PM

Stephen Peer said:

Works great.  This has been driving me crazy.

Thanks for you help.

Stephen

# July 6, 2009 12:26 AM

elvstine said:

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

# July 9, 2009 6:49 AM

Matthew said:

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

# July 9, 2009 9:05 AM

Bertrand Le Roy said:

@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: www.asp.net/cssadapters

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

# July 9, 2009 2:28 PM

danludwig said:

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

# July 9, 2009 9:13 PM

Bertrand Le Roy said:

Well, the menu control is getting redone from the ground up in 4.0, and should work in all browsers. I'll triple-check though.

# July 10, 2009 2:39 AM

Bilal Al-Soudi said:

Just Dandy! ..It worked .. Great post

# July 15, 2009 5:24 PM

Tom said:

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

# July 20, 2009 11:43 PM

Bertrand Le Roy said:

@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.

# July 21, 2009 3:20 PM

evgeni said:

Bertrand: of course is not good idea but as a qick fix may work.

Other option is to replace it with

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

which is slightly older standard

# July 22, 2009 5:18 AM

Daniel Hodgin said:

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.

# July 24, 2009 10:24 AM

Bertrand Le Roy said:

@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.

# July 25, 2009 1:21 AM

Seeqa said:

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.....

# August 1, 2009 1:11 PM

Dale Wilken said:

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.

# August 5, 2009 3:57 AM

Bertrand Le Roy said:

@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.

# August 5, 2009 1:18 PM

Don said:

Bertrand,

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

# August 13, 2009 9:45 PM

Dale said:

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.

# August 14, 2009 4:14 PM

Bertrand Le Roy said:

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

# August 17, 2009 4:14 AM

whuili_2006 said:

I am using the Windows server 2003 and would like to fix this problem now. However, when I use code.msdn.microsoft.com/.../ProjectReleases.aspx ,

I get "The specified release was not found."

When I go to support.microsoft.com/.../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.

# August 21, 2009 1:59 AM

petersga said:

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?

# September 24, 2009 6:10 PM

Bertrand Le Roy said:

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

# September 24, 2009 6:13 PM

petersga said:

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?

# September 24, 2009 8:32 PM

Bertrand Le Roy said:

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

# September 24, 2009 8:53 PM

Fran said:

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

thanks

# October 16, 2009 1:43 PM

Bertrand Le Roy said:

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

# October 16, 2009 2:33 PM

Bertrand Le Roy said:

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

# November 3, 2009 2:51 PM

Schubert said:

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.

# November 4, 2009 1:33 PM

Bertrand Le Roy said:

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

# November 4, 2009 1:59 PM

Yisman said:

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

# January 4, 2010 3:59 AM

Bertrand Le Roy said:

@Yisman: yes they do, and they should lead you to this: 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.

# January 4, 2010 4:05 AM

Baskar.S said:

evgeni said:

Remove this from your .aspx

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/.../xhtml1-transitional.dtd">

And menu starts working. (at least for me)

Baskar said: Thanks evgeni its working fine

# January 11, 2010 4:41 AM

narendra said:

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.

# February 9, 2010 4:22 AM

Bertrand Le Roy said:

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

# February 9, 2010 2:08 PM

narendra said:

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

# February 10, 2010 3:25 AM

Bertrand Le Roy said:

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

# February 10, 2010 3:50 AM

narendra said:

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?

# February 10, 2010 5:15 AM

Maulik and Chaitali said:

It is posible to display submenu using

remove your old !DOCTYPE

and add <body scroll="no"> insted of <body

# February 11, 2010 1:42 AM

Bertrand Le Roy said:

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

# February 11, 2010 1:48 AM

Scott Nettetlon said:

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?

# February 18, 2010 2:22 PM

Bertrand Le Roy said:

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

# February 18, 2010 2:43 PM

ramin said:

using code betwin tag head

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

# April 5, 2010 1:13 AM

Kyle Baek said:

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~!!

# April 23, 2010 1:54 AM

segue said:

Thanks Rob for fixing the problem.

Now my site menu works in all browsers.

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

Cheers.

# May 31, 2010 8:14 PM

Bertrand Le Roy said:

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

# May 31, 2010 8:18 PM

Si6arp said:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

Is Good Idea . Working Fine.

Thanks

Iranian Programmers

# June 20, 2010 5:27 AM

Carlos said:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> works fine, thanks ramin.

# July 28, 2010 2:01 PM

Ed said:

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?

# August 19, 2010 7:34 PM

Bertrand Le Roy said:

@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.

# August 19, 2010 7:42 PM

Caesar Dutta said:

How to get the hotfix hotfix 981201

# September 16, 2010 4:31 AM

Bertrand Le Roy said:

@Caesar: call support.

# September 16, 2010 12:37 PM

Mitul said:

@ ramin

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

Thanks, Thanks A LOT..

# September 17, 2010 7:58 AM

anil said:

Thanks mauli and chetali

It works fine

remove your old !DOCTYPE

and add <body scroll="no"> insted of <body

# November 17, 2010 8:29 AM

sankayan said:

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?

# November 18, 2010 6:14 AM

Bertrand Le Roy said:

@sankayan: upgrade?

# November 18, 2010 12:53 PM

maulesh said:

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

# January 27, 2011 1:05 AM

Herman said:

My problem with asp.net 4.0 is that the menu is aligned in left side in place of the center of the screen, like maulesh.

Is there a solution?

# February 11, 2011 4:52 PM

Bertrand Le Roy said:

@Herman: contact support.

# February 11, 2011 4:58 PM

Bertrand Le Roy said:

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...

# March 14, 2011 1:59 PM

rswank said:

I had a calendar control with an apparent negative z-index and removing <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/.../xhtml1-transitional.dtd">

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.

# December 19, 2011 11:39 AM

Bertrand Le Roy said:

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.

# December 19, 2011 7:26 PM