private void categoryChanged() { //Get the selected category object Category cat = new Category(); cat.GetCategoryByID(Convert.ToInt32(TreeViewLeftNav.SelectedValue)); //Set the title for content section subcategoryTitle.InnerText = cat.Name.ToString(); //Get all products for this category Product prod = new Product(); List<Product> prods = prod.GetAllProductsByCategoryID(Convert.ToInt32(TreeViewLeftNav.SelectedValue),true); DataListProducts.DataSource = prods; DataListProducts.DataBind(); }