protected void GiftCertificatesGridView_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { string key = (string)GiftCertificatesGridView.DataKeys[e.RowIndex].Value; if (key != string.Empty) { if (MTApp.DestroyProduct(key)) { MessageBox1.ShowOk("Gift certificate was deleted successfully"); MessageBox2.ShowOk("Gift certificate was deleted successfully"); } else { MessageBox1.ShowError("An error occurred while trying to delete the gift certificate"); MessageBox2.ShowError("An error occurred while trying to delete the gift certificate"); } } BindGiftCertificateGridView(); e.Cancel = true; }