protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Update") { int index = Convert.ToInt32(e.CommandArgument); Response.Redirect("UpdatePaymentType.aspx?id=" + index); } if (e.CommandName == "Delete_Payment") { int index = Convert.ToInt32(e.CommandArgument); Response respond = PaymentController.DeletePaymentType(index); if (respond.successStatus == false) { alert.Text = respond.message; } else { Response.Redirect("ViewPaymentType.aspx"); } } }