protected void GV_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "edit") { Response.Redirect("setupproducts.aspx?prod_id=" + e.CommandArgument); } else if (e.CommandName == "delete") { using (var db = new bigshopeEntities()) { int prod_id = Convert.ToInt32(e.CommandArgument); db.deleteProduct(prod_id); db.SaveChanges(); FillProducts(); } } }