B
bob8000
Hello everyone,
I am completly new to ASP.NET and I am attempting to design a web site
with it and VB.NET
I have been following an example from a book which as taken me to the
point where I want to branch out and add my own things to the website.
I have a MS SQL Server database that I am using to store the
information I need for the website content
In the book example they use a Datalist with a nested repeater, which
I have working fine.
However the book example lists all the products on one page.
I would like to know how I could filter the results that are viewed on
each page
I will be listing ebooks on my site and have five catagories that I
need to list them in.
Computing
Internet
Finance
Food
Software
the repeater code of have is:
<ItemTemplate>
<asp:Image ID="Image4" runat="server" AlternateText='<%#
Eval("ItemName") %>' ImageAlign="Left"
ImageUrl='<%# Eval("GraphicFileName", "images/{0}")
%>' Style="margin: 5px 10px 5px 0px" />
<asp:Label ID="Label2" runat="server" Font-Bold="True"
Font-Size="1.2em" Text='<%# Eval("MenuItemType") %>'></asp:Label>
-
<asp:Label ID="Label3" runat="server" Font-Bold="True"
Font-Size="1.2em" Text='<%# Eval("ItemName") %>'></asp:Label><br />
<br />
<asp:Repeater ID="Repeater1" runat="server" DataSource='<
%# CType(Container.DataItem, DataRowView).CreateChildView("MenuLink")
%>' OnItemCommand="Repeater1_ItemCommand">
<ItemTemplate>
<span style="color: Firebrick;">
<asp:LinkButton ID="OrderItem" runat="server"
ToolTip="Add item to order" style="text-decoration:none;"
CommandArgument='<%# Eval("ItemPrice")
%>'>
<asp:Image ID="Image1" runat="server"
ImageUrl="~/images/TrolleyIcon.gif"
AlternateText="Add item to order button" />
<%#Eval("ItemPrice", "£{0:F2}")%>
</asp:LinkButton>
</span>
</ItemTemplate>
</asp:Repeater>
<br />
<br />
<asp:HyperLink ID="HyperLink1" runat="server" Font-
Bold="True" Font-Names="Corbel"
Font-Size="Large">Details</asp:HyperLink>
</ItemTemplate>
There is a field named menuItemType in my database and this lists the
catagories that I mentioned above.
So how would I modify this to just show items from the FOOD catagory
on the web page?
I hope I have explained myself OK
Thanks
I am completly new to ASP.NET and I am attempting to design a web site
with it and VB.NET
I have been following an example from a book which as taken me to the
point where I want to branch out and add my own things to the website.
I have a MS SQL Server database that I am using to store the
information I need for the website content
In the book example they use a Datalist with a nested repeater, which
I have working fine.
However the book example lists all the products on one page.
I would like to know how I could filter the results that are viewed on
each page
I will be listing ebooks on my site and have five catagories that I
need to list them in.
Computing
Internet
Finance
Food
Software
the repeater code of have is:
<ItemTemplate>
<asp:Image ID="Image4" runat="server" AlternateText='<%#
Eval("ItemName") %>' ImageAlign="Left"
ImageUrl='<%# Eval("GraphicFileName", "images/{0}")
%>' Style="margin: 5px 10px 5px 0px" />
<asp:Label ID="Label2" runat="server" Font-Bold="True"
Font-Size="1.2em" Text='<%# Eval("MenuItemType") %>'></asp:Label>
-
<asp:Label ID="Label3" runat="server" Font-Bold="True"
Font-Size="1.2em" Text='<%# Eval("ItemName") %>'></asp:Label><br />
<br />
<asp:Repeater ID="Repeater1" runat="server" DataSource='<
%# CType(Container.DataItem, DataRowView).CreateChildView("MenuLink")
%>' OnItemCommand="Repeater1_ItemCommand">
<ItemTemplate>
<span style="color: Firebrick;">
<asp:LinkButton ID="OrderItem" runat="server"
ToolTip="Add item to order" style="text-decoration:none;"
CommandArgument='<%# Eval("ItemPrice")
%>'>
<asp:Image ID="Image1" runat="server"
ImageUrl="~/images/TrolleyIcon.gif"
AlternateText="Add item to order button" />
<%#Eval("ItemPrice", "£{0:F2}")%>
</asp:LinkButton>
</span>
</ItemTemplate>
</asp:Repeater>
<br />
<br />
<asp:HyperLink ID="HyperLink1" runat="server" Font-
Bold="True" Font-Names="Corbel"
Font-Size="Large">Details</asp:HyperLink>
</ItemTemplate>
There is a field named menuItemType in my database and this lists the
catagories that I mentioned above.
So how would I modify this to just show items from the FOOD catagory
on the web page?
I hope I have explained myself OK
Thanks