Hello I had problem
I want to delete row from my datatable through asp:linkbutton. How can I do this. I had the following code, but it adds another row to the table
protected void delCart(object s, DataTableNewRowEventArgs e)
{
dt = (DataTable)Session["Cart"];
dt.Rows[e.Item.ItemIndex].Delete();
//dt.Rows(e.Item.ItemIndex).Delete();
int CartItem = (int)Session["cartItem"];
CartItem = CartItem - 1;
Session["cartItem"] = CartItem;
Session["Cart"] = dt;
DataList1.DataSource = dt;
DataList1.DataBind();
updateCart();
Response.Redirect("ShoppingCart.aspx");
}
The updateCart()
just updates the cart values.