[RESOLVED]Where are sub Menu?

I set up the second level menu, but when browse in IE8, there is nothing but an empt box, what’s wrong?

img

/img

Press F12 and inspect the submenu code and check the applied CSS. You can change it to get it working.

<asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6" DisappearAfter="10000"
                        DynamicHorizontalOffset="2" Font-Names="Times New Roman" Font-Overline="False"
                        Font-Size="1.2em" ForeColor="Blue" Orientation="Horizontal"
                        StaticSubMenuIndent="10px" Width="144px">
                        <StaticSelectedStyle BackColor="#FFCC66" />
                        <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                        <DynamicHoverStyle BackColor="#990000" ForeColor="White" />
                        <DynamicMenuStyle BackColor="#FFFF99" />
                        <DynamicItemTemplate>
                            <%# Eval("Text") %>
                        </DynamicItemTemplate>
                        <DynamicSelectedStyle BackColor="#FFCC66" />
                        <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                        <StaticHoverStyle BackColor="#990000" ForeColor="White" />
                        <Items>
                            <asp:MenuItem Text="Files" Value="Files">
                                <asp:MenuItem NavigateUrl="~/Home.aspx" Text="Open" Value="Open"></asp:MenuItem>
                                <asp:MenuItem NavigateUrl="~/About.aspx" Text="New" Value="New"></asp:MenuItem>
                                <asp:MenuItem Text="Save" Value="Save"></asp:MenuItem>
                            </asp:MenuItem>
                            <asp:MenuItem Text="Edit" Value="Edit"></asp:MenuItem>
                            <asp:MenuItem Text="Widows" Value="Widows">
                                <asp:MenuItem NavigateUrl="~/About.aspx" Text="About" Value="About">
                                </asp:MenuItem>
                            </asp:MenuItem>
                        </Items>
                    </asp:Menu>

btw, how to insert a image?

 

it seems microsoft refuse to occupy their space to adopt pics.

another shown

waiting……

zhgart

waiting……

How about post your full code of the page?  I inserted your portion of the code you gave and I got the submenus to appear.  Maybe you have some type of CSS defined that is overriding your display?

Here they are,

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage1.master.cs" Inherits="MasterPage1" %>

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

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <style type="text/css">
        .style1
        {
            width: 100%;
            border: 2px solid #0000FF;
        }
        .style2
        {
            width: 100%;
            height: 85px;
            border: 1px solid #00FFFF;
            background-color: #00FF00;
        }
        .style3
        {
            width: 188px;
        }
        .style4
        {
            width: 373px;
        }
        .style5
        {
            width: 439px;
        }
    </style>
</head>
<body bgcolor="#ffff99">
    <form id="form1" runat="server">
    <div style="height: 124px; width: 917px; margin-top: 0px;">
        
        <table bgcolor="#CCFF33" class="style2">
            <tr>
                <td class="style3">
                    This is table</td>
                <td class="style4">
                    <asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6" DisappearAfter="10000"
                        DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Overline="False"
                        Font-Size="Medium" ForeColor="#990000" Orientation="Horizontal"
                        StaticSubMenuIndent="10px" Width="330px" Height="52px"
                        style="margin-left: 0px">
                        <StaticSelectedStyle BackColor="#FFCC66" />
                        <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                        <DynamicHoverStyle BackColor="#990000" ForeColor="White" />
                        <DynamicMenuStyle BackColor="#FFFBD6" />
                        <DynamicItemTemplate>
                            <%# Eval("Text") %>
                        </DynamicItemTemplate>
                        <DynamicSelectedStyle BackColor="#FFCC66" />
                        <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                        <StaticHoverStyle BackColor="#990000" ForeColor="White" />
                        <Items>
                            <asp:MenuItem Text="Files" Value="Files">
                                <asp:MenuItem NavigateUrl="~/Home.aspx" Text="Open" Value="Open"></asp:MenuItem>
                                <asp:MenuItem NavigateUrl="~/About.aspx" Text="New" Value="New"></asp:MenuItem>
                                <asp:MenuItem Text="Save" Value="Save"></asp:MenuItem>
                            </asp:MenuItem>
                            <asp:MenuItem Text="Edit" Value="Edit" NavigateUrl="~/Default.aspx"></asp:MenuItem>
                            <asp:MenuItem Text="Widows" Value="Widows">
                                <asp:MenuItem NavigateUrl="~/About.aspx" Text="About" Value="About">
                                </asp:MenuItem>
                            </asp:MenuItem>
                        </Items>
                    </asp:Menu>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <br />
        what is this?<br />
        and line<br />
        outof<br />
        <br />
        how</div>
    <p>
        &nbsp;<p>
        holderHead&nbsp; <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
        <p>
            &nbsp;</p>
        <p>
            <br />
        </p>
        
        </asp:ContentPlaceHolder>
    <table cellpadding="2" cellspacing="3" class="style1">
        <tr>
            <td bgcolor="#CCFF99">
                table1</td>
            <td class="style5">
                second</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                third line</td>
            <td bgcolor="#CCFF99" class="style5">
                table 6</td>
        </tr>
    </table>
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
        StartingNodeUrl="~/Home.aspx" />
    <p>
        <asp:TreeView ID="TreeView1" runat="server" ShowLines="True" Width="192px">
            <Nodes>
                <asp:TreeNode Text="新建Files" Value="新建Files">
                    <asp:TreeNode NavigateUrl="~/Home.aspx" Text="新建open" Value="新建open">
                    </asp:TreeNode>
                    <asp:TreeNode NavigateUrl="~/About.aspx" Text="新建Save" Value="新建Save">
                    </asp:TreeNode>
                </asp:TreeNode>
                <asp:TreeNode Text="新建Edit" Value="新建Edit"></asp:TreeNode>
                <asp:TreeNode NavigateUrl="~/About.aspx" Text="新建Help" Value="新建Help">
                </asp:TreeNode>
            </Nodes>
        </asp:TreeView>
    </p>
    <asp:TreeView ID="TreeView2" runat="server" DataSourceID="SiteMapDataSource1"
        ImageSet="Contacts" NodeIndent="10">
        <ParentNodeStyle Font-Bold="True" ForeColor="#5555DD" />
        <HoverNodeStyle Font-Underline="False" />
        <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px"
            VerticalPadding="0px" />
        <DataBindings>
            <asp:TreeNodeBinding DataMember="SiteMapNode" />
            <asp:TreeNodeBinding DataMember="SiteMapNode2" TextField="Url" />
        </DataBindings>
        <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black"
            HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" />
    </asp:TreeView>
    <br />
    <br />
    </form>
    </body>
</html>
and here is stylesheet.css, but I haven't yet use them,

body {


}
a:hover
{
    font-family: 'Times New Roman' , Times, serif;
    font-size: large;
    font-weight: bold;
    text-decoration: underline;
    background-color: #00FFFF;
    position: relative;
    z-index: auto;
    visibility: visible;
}

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage1.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
    Hello, this is uniqe page from masterpage.</p>
<p>
    secong section</p>

    <li>
        <p>
        text Chinese    </p>
</li>
      

</asp:Content>

 

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage1.master.cs" Inherits="MasterPage1" %>

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

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <style type="text/css">
        .style1
        {
            width: 100%;
            border: 2px solid #0000FF;
        }
        .style2
        {
            width: 100%;
            height: 85px;
            border: 1px solid #00FFFF;
            background-color: #00FF00;
        }
        .style3
        {
            width: 188px;
        }
        .style4
        {
            width: 373px;
        }
        .style5
        {
            width: 439px;
        }
    </style>
</head>
<body bgcolor="#ffff99">
    <form id="form1" runat="server">
    <div style="height: 124px; width: 917px; margin-top: 0px;">
        
        <table bgcolor="#CCFF33" class="style2">
            <tr>
                <td class="style3">
                    This is table</td>
                <td class="style4">
                    <asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6" DisappearAfter="10000"
                        DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Overline="False"
                        Font-Size="Medium" ForeColor="#990000" Orientation="Horizontal"
                        StaticSubMenuIndent="10px" Width="330px" Height="52px"
                        style="margin-left: 0px">
                        <StaticSelectedStyle BackColor="#FFCC66" />
                        <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                        <DynamicHoverStyle BackColor="#990000" ForeColor="White" />
                        <DynamicMenuStyle BackColor="#FFFBD6" />
                        <DynamicItemTemplate>
                            <%# Eval("Text") %>
                        </DynamicItemTemplate>
                        <DynamicSelectedStyle BackColor="#FFCC66" />
                        <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                        <StaticHoverStyle BackColor="#990000" ForeColor="White" />
                        <Items>
                            <asp:MenuItem Text="Files" Value="Files">
                                <asp:MenuItem NavigateUrl="~/Home.aspx" Text="Open" Value="Open"></asp:MenuItem>
                                <asp:MenuItem NavigateUrl="~/About.aspx" Text="New" Value="New"></asp:MenuItem>
                                <asp:MenuItem Text="Save" Value="Save"></asp:MenuItem>
                            </asp:MenuItem>
                            <asp:MenuItem Text="Edit" Value="Edit" NavigateUrl="~/Default.aspx"></asp:MenuItem>
                            <asp:MenuItem Text="Widows" Value="Widows">
                                <asp:MenuItem NavigateUrl="~/About.aspx" Text="About" Value="About">
                                </asp:MenuItem>
                            </asp:MenuItem>
                        </Items>
                    </asp:Menu>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <br />
        what is this?<br />
        and line<br />
        outof<br />
        <br />
        how</div>
    <p>
        &nbsp;<p>
        holderHead&nbsp; <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
        <p>
            &nbsp;</p>
        <p>
            <br />
        </p>
        
        </asp:ContentPlaceHolder>
    <table cellpadding="2" cellspacing="3" class="style1">
        <tr>
            <td bgcolor="#CCFF99">
                table1</td>
            <td class="style5">
                second</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                third line</td>
            <td bgcolor="#CCFF99" class="style5">
                table 6</td>
        </tr>
    </table>
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
        StartingNodeUrl="~/Home.aspx" />
    <p>
        <asp:TreeView ID="TreeView1" runat="server" ShowLines="True" Width="192px">
            <Nodes>
                <asp:TreeNode Text="新建Files" Value="新建Files">
                    <asp:TreeNode NavigateUrl="~/Home.aspx" Text="新建open" Value="新建open">
                    </asp:TreeNode>
                    <asp:TreeNode NavigateUrl="~/About.aspx" Text="新建Save" Value="新建Save">
                    </asp:TreeNode>
                </asp:TreeNode>
                <asp:TreeNode Text="新建Edit" Value="新建Edit"></asp:TreeNode>
                <asp:TreeNode NavigateUrl="~/About.aspx" Text="新建Help" Value="新建Help">
                </asp:TreeNode>
            </Nodes>
        </asp:TreeView>
    </p>
    <asp:TreeView ID="TreeView2" runat="server" DataSourceID="SiteMapDataSource1"
        ImageSet="Contacts" NodeIndent="10">
        <ParentNodeStyle Font-Bold="True" ForeColor="#5555DD" />
        <HoverNodeStyle Font-Underline="False" />
        <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px"
            VerticalPadding="0px" />
        <DataBindings>
            <asp:TreeNodeBinding DataMember="SiteMapNode" />
            <asp:TreeNodeBinding DataMember="SiteMapNode2" TextField="Url" />
        </DataBindings>
        <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black"
            HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" />
    </asp:TreeView>
    <br />
    <br />
    </form>
    </body>
</html>

I check up, there is only style4 with only high in it.

 

I havent found anything wrong.  The code seems to work just fine.  I am having no issues using your code and see my submenus appear.

Sometimes I have seen that the changes in styles do not take affect immediately.  Sometimes browser caches the page.  What I would do is close out of your visual studio application and restart it and call up a new browser test on your test page.  Maybe then
the changes in your color will take affect.

I have no other suggestions to help as your code seems to work fine on my end.

Leave a Reply