protected void btnVerify_Click(object sender, EventArgs e) { if (txtCode.Text != "") { if (txtCode.Text == Session["VerificationCode"].ToString()) { try { local_login.DeletUser(Session["deleteid"].ToString()); BindRegistrationDetails(); mpe.Show(); lblError.ForeColor = Color.Green; lblError.Text = "Selected user deleted."; code.Visible = false; txtCode.Visible = false; btnVerify.Visible = false; Session["VerificationCode"] = null; Session["deleteid"] = null; } catch { } } else { mpe.Show(); lblError.ForeColor = Color.Red; lblError.Text = "Invalid user delete code."; } } }
protected void gvRegistration_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete") { string userid = Convert.ToString(e.CommandArgument); local_login.DeletUser(userid); BindRegistrationDetails(); } if (e.CommandName == "Add Money") { string userid = Convert.ToString(e.CommandArgument); Session["NewUserID"] = userid; Response.Redirect("AddMoney.aspx"); } if (e.CommandName == "Deduct Money") { string userid = Convert.ToString(e.CommandArgument); Session["NewUserID"] = userid; Response.Redirect("DeductMoney.aspx"); } }