Hi, I am using these: ASP.Net 2.0, VB.Net, Visual Studio 2005, SQL Server 2005, Objectdatasource using DAL & BLL classes
My objectdatasource can produce below output by CategoryID parameter: (stored procedure: GetProductsByCategoryID )
CategoryID | CollectionID | ProductID | CategoryName | CollectionName | ProductName | ProductPhoto
1 1 3 XYZ ABC Prod3 Photo3.jpg
1 2 4 XYZ BCA Prod4 Photo4.jpg
In my ASP.Net web page, I can able to show the product list (Photo, and below that the product name) in horizontal mode through datalist web control as per requirement. It is working fine.
ASP.Net page code below:
- <asp:DataList ID="DataList1" runat="server" DataKeyField="ProductID" DataSourceID="ProductsByCategoryDataSource" RepeatColumns="4" RepeatDirection="Horizontal">
-
<ItemTemplate>
-
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Photo") %>' ToolTip='<%# Eval("Description") %>' /><br /><asp:HyperLink ID="ProductIDHyperLink" runat="server" NavigateUrl='<%#String.Format("ProductDetails.aspx?CategoryID={0}&ProductID={1}",DataBinder.Eval(Container,"DataItem.CategoryID"),DataBinder.Eval(Container,"DataItem.ProductID"))%>' Text='<%# Eval("Description")%>'></asp:HyperLink>
-
</ItemTemplate>
-
</asp:DataList>
-
<asp:ObjectDataSource ID="ProductsByCategoryDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetProductsByCategoryID" TypeName="ProductsBLL" EnableViewState="False">
-
<SelectParameters>
-
<asp:QueryStringParameter Name="CategoryID" QueryStringField="CategoryID" Type="Int32" />
-
</SelectParameters>
-
</asp:ObjectDataSource>
But my new requirement is to show the collectionswise (sub headings) products in the outer web control. If it is categorywise, my job will be easier. Because in outer web control, I will get the categorylist and inner web control will take the specific categoryID as parameter to produce the list.
How can I achieve my new requirement? Please help.