I need to define what a child is:
I need to write something like var parent = categoryID == ParentCategoryID = 0
Here is my ASCX control:
protected void Page_Load(object sender, EventArgs e)
{
categoriesBLL categoriesLogic2 = new categoriesBLL();
rptCategories.DataSource = categoriesLogic2.GetCategories();
rptCategories.DataBind();
}
I am display the values from a query which show up like this:
<ul class="categories">
<li>Computers</li>
<li>Hardware</li>
<li>Software</li>
</ul>
As you can see hardware and software should be sub categories but they show up in the same UL block as just another LI.
My Dataset looks like this:

I have a query which will determine the sub categories here:
SELECT c1.CategoryID, c2.ParentCategoryID,
c1.Name, c2.Name AS ParentName,
c1.Published, c1.Deleted, c1.PictureID
FROM Nop_Category AS c1 INNER JOIN
Nop_Category AS c2 ON c1.ParentCategoryID = c2.CategoryID
WHERE (c1.Deleted = 0)
AND (c1.Published = 1)
AND (c1.ParentCategoryID = @ParentCategoryID)
But how to pass the value for a category into my dataset for it to return the results?
I then need to create a new ul li:
<ul class="sub-category">
<li>Hardware</li>
<li>Software</li>
</ul>
and return result you want
Dialog select use exisitng stored procedure Select the stored
procedure you created in step 1
Now you can use the method in your code like this Nop_CategoryTableAdapter.GetSubCategoriesByParentId and pass the parentCategoryId to get subcategories back