jamesthecat
04-07-2003, 01:55 PM
Hi, I'm trying to do something that I thought would be simple but I can't seem to work it out.
Basically I have a list of useful links on a page which are displayed in alphabetical order in a datalist. I want to allow the user to navigate by using an alphabet at the top of the page. My database includes an initial letter field (cipher, cipher_id)so I've tried creating another datalist in which the letters are hyperlinked to corresponding anchor name tags but it doesn't seem to work.
Code looks like this:
<form runat="server">
<asp:DataList id="listInitials"
runat="server"
RepeatColumns="26"
RepeatDirection="Horizontal"
RepeatLayout="Table"
DataSource="<%# dsInitials.DefaultView %>" >
<ItemTemplate>
<a href="#<%# dsInitials.FieldValue("cipher_id", Container) %>">
<%# dsInitials.FieldValue("cipher", Container) %>
</a> </ItemTemplate>
</asp:DataList>
<asp:DataList id="DataList1"
runat="server"
RepeatColumns="1"
RepeatDirection="Vertical"
RepeatLayout="Flow"
DataSource="<%# procLinks.DefaultView %>" >
<ItemTemplate>
<p>
<a name="<%# dsInitials.FieldValue("cipher_id", Container) %>"></a>
<span class="bold">
<%# procLinks.FieldValue("item_title", Container) %>
</span><br>
<%# procLinks.FieldValue("item_intro", Container) %>
<br>
<a href="http://<%# procLinks.FieldValue("item_detail", Container) %>">
<%# procLinks.FieldValue("item_detail", Container) %>
</a>
<hr class="line">
<p></p>
</ItemTemplate>
</asp:DataList>
</form>
Basically I have a list of useful links on a page which are displayed in alphabetical order in a datalist. I want to allow the user to navigate by using an alphabet at the top of the page. My database includes an initial letter field (cipher, cipher_id)so I've tried creating another datalist in which the letters are hyperlinked to corresponding anchor name tags but it doesn't seem to work.
Code looks like this:
<form runat="server">
<asp:DataList id="listInitials"
runat="server"
RepeatColumns="26"
RepeatDirection="Horizontal"
RepeatLayout="Table"
DataSource="<%# dsInitials.DefaultView %>" >
<ItemTemplate>
<a href="#<%# dsInitials.FieldValue("cipher_id", Container) %>">
<%# dsInitials.FieldValue("cipher", Container) %>
</a> </ItemTemplate>
</asp:DataList>
<asp:DataList id="DataList1"
runat="server"
RepeatColumns="1"
RepeatDirection="Vertical"
RepeatLayout="Flow"
DataSource="<%# procLinks.DefaultView %>" >
<ItemTemplate>
<p>
<a name="<%# dsInitials.FieldValue("cipher_id", Container) %>"></a>
<span class="bold">
<%# procLinks.FieldValue("item_title", Container) %>
</span><br>
<%# procLinks.FieldValue("item_intro", Container) %>
<br>
<a href="http://<%# procLinks.FieldValue("item_detail", Container) %>">
<%# procLinks.FieldValue("item_detail", Container) %>
</a>
<hr class="line">
<p></p>
</ItemTemplate>
</asp:DataList>
</form>