[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 854
  • Last Modified:

nested repeater menu

I would like to have a horizontal nested repeater menu , using a few day still didn't success, please help.

vertical structure data as below example Home
               FieldA - FieldA1
                          - FieldA2
               FieldB - FieldB1
               FieldC - FieldC1
                          - FieldC2
                          - FieldC3

now i want showstarting node=false, instance using FieldA as root url="~/", Home have no url.

the result i want is like www.templatemonster.com menu

please help with code and css
0
john8098
Asked:
john8098
  • 5
  • 3
1 Solution
 
aibusinesssolutionsCommented:
Have you tried using the built in Menu control with asp.net?

<asp:Menu ID="Menu1" runat="server"></asp:Menu>

You can use an XML file or a SiteMap file as a datasource for it, there is also a SQL datasource adapter somewhere if you need dynamic menus.

It does all the javascript for you, you just use CSS to format it.
0
 
john8098Author Commented:
aspnet menu generate table, what is i dun want to use it?
0
 
aibusinesssolutionsCommented:
Not if you use the CSS Friendly adapter.

http://www.codeplex.com/cssfriendly/Release/ProjectReleases.aspx?ReleaseId=2159

It generates this for your menu:
<div class="AspNet-Menu-Horizontal">
    <ul class="AspNet-Menu">
        <li class="AspNet-Menu-TopLevel-register">
              <a href="/Register.aspx">REGISTER</a>
        </li>
        <li class="AspNet-Menu-TopLevel-news">
              <a href="/News.aspx">NEWS</a>
        </li>
        <li class="AspNet-Menu-TopLevel-about-Selected">
            <a href="/About.aspx">ABOUT</a>
        </li>
    </ul>
</div>

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
john8098Author Commented:
CSS Friendly adapter compatible in safari , firefox , ie ?
0
 
aibusinesssolutionsCommented:
Yes, it's cross browser compliant.

Here is an example of it in use: http://www.asp.net/CSSAdapters/Menu.aspx
0
 
john8098Author Commented:
i used to be using nested repeater bound to sitemapdatasource. now i try this.
0
 
john8098Author Commented:
i try nested repeater, any expert guru can give me the css code to resultstructure like www.templatemonster.com 

<asp:Repeater ID="mnuheader1" runat="server" DataSourceID="SiteMapDataSource1" EnableViewState="false" >
                           
                            <HeaderTemplate><ul></HeaderTemplate>
                            <ItemTemplate><li><a href="<%# Eval("url") %>" title="<%# Eval("description") %>">
                                    <%# Eval("title") %></a></li>
                                <asp:Repeater ID="mnuheader2" runat="server" DataSource='<%# CType(Container.DataItem, SiteMapNode).ChildNodes %>' EnableViewState="false" >
                                    <HeaderTemplate></HeaderTemplate>
                                    <ItemTemplate><li><a href="<%# Eval("url") %>" title="<%# Eval("description") %>">
                                    <%# Eval("title") %></a></li>
                                <asp:Repeater ID="mnuheader3" runat="server" DataSource='<%# CType(Container.DataItem, SiteMapNode).ChildNodes %>' EnableViewState="false" >
                                        <HeaderTemplate><ul></HeaderTemplate>
                                        <ItemTemplate><li><a href="<%# Eval("url") %>" title="<%# Eval("description") %>">
                                            <%# Eval("title") %></a></li>
                                        </ItemTemplate>
                                        <FooterTemplate></ul></FooterTemplate>
                                </asp:Repeater>
                                </ItemTemplate>
                                    <FooterTemplate></FooterTemplate>
                                </asp:Repeater>                
                            </ItemTemplate>
                            <FooterTemplate></ul></FooterTemplate>
                        </asp:Repeater>
0
 
john8098Author Commented:
force accept.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now