Andile Choko

Andile Choko

  • NA
  • 53
  • 54.3k

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

Apr 19 2011 4:55 AM
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)