I have a datalist that I want to list the Products that are comming from the Querystring. It works like this: Default.aspx/?ProductID=1
I get 1 product like I want.
But I want to add more products like this Default.aspx/?ProductID=1,15,25
and get three products back. How do I make that to work?
<asp:DataList ID="DataList1" runat="server">
<ItemStyle VerticalAlign="Top" />
<ItemTemplate>
<a href="../Product/Default.aspx?ProductID=<%#Eval("ProductID") %>">
<asp:Label ID="lblName" runat="server" Text='<%#Eval("Name") %>' />
<asp:Label ID="lblPrice" runat="server" Text='<%#Eval("Price") %>' />
</a>
</ItemTemplate>
</asp:DataList>
protected void Page_Load(object sender, EventArgs e)
{
string id = Request.QueryString["ProductID"];
DataTable table = CategoryAccess.GetList(id);
list.DataSource = table;
list.DataBind();
}
ALTER PROCEDURE GetList
@ProductID INT
AS
SELECT ProductID, Name, Price
FROM Product
WHERE (ProductID = @ProductID)