ASP.NET CSS Adapters without crazy js injected for "help"

The game object in this case should use a Treeview with a sitemap provider - and implement with CSS. I am guessing it can be done with a set of CSS adapters.

I hooked up the adapters using a DLL implementation and there I get my basic tree view, but it seems to use all kinds of js that allow me to push to nodes etc. In my case, I just want to display a hierarchy with nested UL and LIs. I dont want js to click click!

Is there a way to accomplish this without using a separate adapter project and rewriting the code to convert / render the tree view?

I am also open to other options, which aim for a simple hierarchy in the tree / menu and a summary coming out of the XML file.

thank!

+1


source to share


2 answers


I would use a relay like in this example taken from the asp.net data access tutorials:

<asp:Repeater runat="server" ID="menu" DataSourceID="SiteMapDataSource1">
    <ItemTemplate>
        <li>
            <asp:HyperLink runat="server"
             NavigateUrl='<%# Eval("Url") %>'>
             <%# Eval("Title") %></asp:HyperLink>

            <asp:Repeater runat="server"
             DataSource="<%# CType(Container.DataItem,
             SiteMapNode).ChildNodes %>">
                <HeaderTemplate>
                    <ul>
                </HeaderTemplate>

                <ItemTemplate>
                    <li>
                        <asp:HyperLink runat="server"
                         NavigateUrl='<%# Eval("Url") %>'>
                         <%# Eval("Title") %></asp:HyperLink>
                    </li>
                </ItemTemplate>

                <FooterTemplate>
                    </ul>
                </FooterTemplate>
            </asp:Repeater>
        </li>
    </ItemTemplate>
</asp:Repeater>

      



Here's a link to the entire article: Main Pages and Site Navigation

I forgot to mention, I would not use css adapters, I heard it is a pain.

+1


source


CSS adapters are provided as SAMPLE code. This is why they are in their own namespace and not in the System or Microsoft namespace. The idea is that you can customize them to suit your needs.



If you don't need Js, edit the code and remove it. Also, use your own code instead.

0


source







All Articles