protected void lnkReject_OnClick(object sender, EventArgs e) { var linkButton = sender as LinkButton; if (linkButton != null) { var gvRow = linkButton.NamingContainer as GridViewRow; var id = GvTestimony.DataKeys[gvRow.RowIndex].Value.ToString(); using (var sqlConnection = new SqlConnection(_conn)) { using (var sqlCommand = new SqlCommand("SP_DeleteTestimonyById", sqlConnection)) { sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.AddWithValue("@OwnStoryId", id); sqlConnection.Open(); var result = sqlCommand.ExecuteNonQuery(); sqlConnection.Close(); if (result == 1) { TestimoniesGrid(); } ...

Go to the complete details ...