Link to home
Start Free TrialLog in
Avatar of dodgerfan
dodgerfanFlag for United States of America

asked on

How can i get rid of asp:Menu flickering?

I'm using ASP.net/C# with Visual Studio 2008. When any postback happens and the page gets rendered again the menu "flickers" for a moment and all  menu items are shown before a return to the normal display. I've found some suggestions, but nothing has worked so far.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

this is the trick I read in some places (I presume you are using Master Pages?)
The flickering is because asp:Menu uses javascript to set some inline styles.

hence, set your css file:
#menu ul li ul
{
    display: none;
}

#menu ul li 
{
    position: relative; 
    float: left;
    list-style: none;
}

Open in new window


and the flickering should be gone.
the trick is that the display will be "none" by default (while building the menu) and then showing only what is needed when done, and not building "all visible" and then hiding what is not needed
Avatar of dodgerfan

ASKER

I am using a Master page. I did find that code and tried it, but the flicker still occurs. My style sheet is attached. Could I have something else in there messing with it?Site.css
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This did not work, either. I'm still trying to figure it out but looking at different ways to render a menu, too.