[RESOLVED] Problem with GridView Deleting Basket Class Data
BasketBLL class
Code:
public void RemoveBasketItem(int index)
{
_basketItems.RemoveAt(index);
}
Cart.aspx
In Events: Row Deleting
Code:
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int rowToDelete = e.RowIndex;
TextBox4.Text = rowToDelete.ToString();
Basket DeleteBasket = new Basket();
DeleteBasket.RemoveBasketItem(rowToDelete);
GridView1.DataBind();
}
Error: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Anyone have any idea how to solve this?
Re: Problem with GridView Deleting Basket Class Data
This looks like a block of C code, wrong forum my friend.
Re: [RESOLVED] Problem with GridView Deleting Basket Class Data
Yes, sorry my fault I copied it over to the C# now. Thanks