How to get rid of ugly asp:Menu flickering?

后端 未结 12 1214
遥遥无期
遥遥无期 2020-12-24 14:37

I\'m using the asp:Menu control on an ASP.NET 4.0 Webforms page with table-free rendering mode:



        
12条回答
  •  太阳男子
    2020-12-24 14:57

    I added:

    .menu ul li ul
    {
        display: none;
    }
    
    .menu ul li 
    {
        position: relative; 
        /*float: left;*/
        list-style: none;
    }

    at botton of ccs file and when I published the application the flickering effect was reduced. Before changes, menu items covered almost the whole page and after your solution only 5 or 6 rows!!!.

    This is my master page:

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="SantaMaria.SiteMaster" %>
    
    
    
    
        
        
        
        
    
    
    
    
    
        

    [ Log In ] <%=Xsite.Override.getOverride("SiteMaster", "Welcome") %> ! [ ]

    and this is the ccs file definitios for asp:menu (without the new lines which I paste at botton of ccs file):

    div.hideSkiplink 
    {
        background-color: /*#3a4f63;*/ #666666;
        width: 100%;
    }
    
    div.menu
    {
        padding: 2px 0px 2px 4px;
    }
    
    div.menu ul
    {
        list-style: none;
        margin: 0px;
        padding: 0px;
        width: auto;
        z-index: 10; /*Se estaba mostrando el submenu, mezclado con la pantalla de abajo!*/
    }
    
    div.menu ul li a, div.menu ul li a:visited
    {
        background-color: #465c71;
        border: 1px #4e667d solid;
        color: #dde4ec;
        display: block;
        line-height: 1.35em;
        padding: 4px 20px;
        text-decoration: none;
        white-space: nowrap;
    }
    
    div.menu ul li a:hover
    {
        background-color: #bfcbd6;
        color: #465c71;
        text-decoration: none;
    }
    
    div.menu ul li a:active
    {
        background-color: #465c71;
        color: #cfdbe6;
        text-decoration: none;
    }

    The menu items are loaded from an xml file.

    Well I want to thank you for all your answers about "How to get rid of ugly asp:Menu flickering?" I will continue investigating to find a complete solution. THANKS AGAIN!!!

提交回复
热议问题