BasketBLL class
Cart.aspxCode:public void RemoveBasketItem(int index) { _basketItems.RemoveAt(index); }
In Events: Row Deleting
Error: Index was out of range. Must be non-negative and less than the size of the collection.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(); }
Parameter name: index
Anyone have any idea how to solve this?




Reply With Quote