1
Answer

How do i navigate between records in a generic list(with next, and previous buttons).

Andile Choko

Andile Choko

13y
2.9k
1
im having problems with navigating records sepecially with the next and prevoius buttons. The code below doesn't work


protected void btnNext_Click(object sender, EventArgs e)

{

csProduct objprod = new csProduct();

List<csProduct> objlist = new List<csProduct>();

objlist = objprod.get_all_products();

int rowindex=0;

rowindex++;

foreach (var prod in objlist)

 {




txtProdName.Text = objlist[rowindex].propProduct_Name;

txtPrice.Text = objlist[rowindex].propProduct_UnitPrice.ToString();

txtPrice.Text = objlist[rowindex].propProduct_UnitPrice.ToString();

txtCoName.Text = objlist[rowindex].propCompanyName;

rowindex++;

 }


}
Answers (1)