none
asp.net 4 menu List Render problem RRS feed

  • 一般討論

  • I use the staticitemTemplate and dynamicitem Template together and rendermode = "List"

    However it show all the menu items in output (show all include submenu in one column) in IE7,8.  Firefox is no problem. I also create a new .net website project to test it.(notic that if rendermode ="table" IE and firefox show it correctly).

    -------------------------------------

    code

    <asp:Menu ID="AdminMenuLeft" runat="server" DataSourceID="SiteMapDataSource1" MaximumDynamicDisplayLevels="5"
                        DynamicHorizontalOffset="2" DisappearAfter="300"
                  
                      CssClass="menu"
                RenderingMode="Default" Orientation="Vertical" >
                        <DataBindings>
                            <asp:MenuItemBinding DataMember="SiteMapNode" ImageUrlField="Title" NavigateUrlField="Url"
                                TextField="Description" />
                        </DataBindings>
                      <StaticItemTemplate>
                            <asp:Panel ID="PanBackGround" runat="server" BackImageUrl="~/images/MenustaticBackGround150.png"
                                CssClass="menuItemBackGround" Height="25px" HorizontalAlign="Left">
                                <div class="linkMenu">
                                    <asp:HyperLink ID="linkMenu" runat="server" CssClass="menuItemLink" NavigateUrl='<%# Eval("NavigateUrl") %>'
                                        Text='<%# Eval("Text") %>' Width="100%" Font-Underline="False" ForeColor="#57575A"></asp:HyperLink>
                                </div>
                            </asp:Panel>
                        </StaticItemTemplate>
                       
                      <DynamicItemTemplate>
                            <asp:Panel ID="PanBackGround" runat="server" BackImageUrl="~/images/MenuBackGround.png"
                                CssClass="menuSubItemBackGround" Height="25px" Width="200px" HorizontalAlign="Left">
                                <asp:HyperLink ID="linkMenu" runat="server" CssClass="menuItemLink" NavigateUrl='<%# Eval("NavigateUrl") %>'
                                    Text='<%# Eval("Text") %>' Width="190px"></asp:HyperLink>
                            </asp:Panel>
                        </DynamicItemTemplate>
                    </asp:Menu>

    • 已變更類型 a-talinModerator 2011年3月9日 上午 03:50 發問者自行解答
    2011年3月4日 上午 09:31

所有回覆

  • 被你的panel給影響到了吧

    <StaticItemTemplate>
        <asp:HyperLink ID="linkMenu" runat="server" CssClass="menuItemLink" NavigateUrl='<%# Eval("NavigateUrl") %>'
            Text='<%# Eval("Text") %>' Width="100%" Font-Underline="False" ForeColor="#57575A"></asp:HyperLink>
    </StaticItemTemplate>
    <DynamicItemTemplate>
        <asp:HyperLink ID="linkMenu" runat="server" CssClass="menuItemLink" NavigateUrl='<%# Eval("NavigateUrl") %>'
            Text='<%# Eval("Text") %>' Width="190px"></asp:HyperLink>
    </DynamicItemTemplate>

     

    2011年3月5日 上午 07:38
    版主
  • I found out the problem. thx

    It is because the <asp:HyperLink>. I change to label. It works.

    I use hyperlink here because i am using .net 3.5 before.

    But i don't know why same code <hyperlink> work in firefox but not ie. ha

    2011年3月5日 上午 11:32