QBall777
11-06-2007, 10:02 PM
Hi
I've got a <asp: dropdownlist> that lists categories form my database, when you click a category the page is posted back with the products for that category. My question is I do not want to use a drop down list I wish to use something I can style like a repeater. I'm really struggling with the repeater, below is the code I'm using.
Drop down list. This works fine
<div class="main_nav">
<asp:DropDownList ID="ddlCategory" runat="server"
AutoPostBack="True"
DataSourceID="SqlDataSource1"
DataTextField="name"
DataValueField="catid" AppendDataBoundItems="false">
</asp:DropDownList>
Repeater. This is not working
<asp:Repeater id="myRepeaterUL" runat="server" DataSourceID="SqlDataSource1">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<ItemTemplate>
<li><a href="<%# DataBinder.Eval(Container.DataItem, "catid") %>">
<%# DataBinder.Eval(Container.DataItem, "name") %></a></li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
Hope someone can help.
I've got a <asp: dropdownlist> that lists categories form my database, when you click a category the page is posted back with the products for that category. My question is I do not want to use a drop down list I wish to use something I can style like a repeater. I'm really struggling with the repeater, below is the code I'm using.
Drop down list. This works fine
<div class="main_nav">
<asp:DropDownList ID="ddlCategory" runat="server"
AutoPostBack="True"
DataSourceID="SqlDataSource1"
DataTextField="name"
DataValueField="catid" AppendDataBoundItems="false">
</asp:DropDownList>
Repeater. This is not working
<asp:Repeater id="myRepeaterUL" runat="server" DataSourceID="SqlDataSource1">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<ItemTemplate>
<li><a href="<%# DataBinder.Eval(Container.DataItem, "catid") %>">
<%# DataBinder.Eval(Container.DataItem, "name") %></a></li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
Hope someone can help.