DataList and dataSource issues

A

Andy B

I have the following code. Is there another way to simplify it but get the
exact same thing done? It is a DataList that gets the nodes from a
SiteMapDataSource and displays them on the page as a list of links.

<asp:DataList runat="server" ID="EternityRecordsNavigationLinks"
DataSourceID="SiteMapDataSource1" Caption="Eternity Records"
CssClass="EternityRecordsNavigationLinks" UseAccessibleHeader="True">

<HeaderTemplate>

<ul>

</HeaderTemplate>

<FooterTemplate>

</ul>

</FooterTemplate>

<ItemTemplate>

<asp:DataList ID="Repeater1" runat="server" DataSource='<%#
CType(Container.DataItem, SiteMapNode).ChildNodes %>'>

<ItemTemplate>

<li>

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

</li>

</ItemTemplate>

</asp:DataList>

</ItemTemplate>

</asp:DataList>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top