Hi
I am getting error - 'mbox_ascx' does not contain a definition for 'lnkRecordDelete_Click' and no accessible extension method 'lnkRecordDelete_Click' accepting a first argument of type 'mbox_ascx' could be found (are you missing a using directive or an assembly reference?)
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MBox.ascx.cs" Inherits="Payroll.MBox" %> <script type="text/javascript"> var swalInit = swal.mixin({ buttonsStyling: false, confirmButtonClass: 'btn btn-primary', cancelButtonClass: 'btn btn-light' }); function ShowPopup_Redirect(heading, body, type, url) { swalInit.fire({ title: heading, text: body, type: type, position: 'top', allowOutsideClick: false; } }); } </script> <div id="modal_Delete" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title"> <asp:Label ID="Label1" Text="Are You Sure, You want to Delete This?" runat="server"></asp:Label></h5> <button type="button" class="bootbox-close-button close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <div class="bootbox-body"> <div class="bootbox-form"> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-link" data-dismiss="modal">Cancel</button> <asp:LinkButton ID="LinkButton1" class="btn bg-danger" runat="server" OnClick="lnkRecordDelete_Click">Delete</asp:LinkButton> </div> </div> </div> </div>
protected void lnkRecordDelete_Click(object sender, EventArgs e) { try { if (hdfId.Value != "0") { try { using (SqlConnection con = new SqlConnection(Common.CommonFunction.cnn_Live)) { SqlCommand cmd = new SqlCommand("sp_EmployeeCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@DocEntryNo", SqlDbType.Int).Value = hdfId.Value; cmd.Parameters.Add("@Action", SqlDbType.NVarChar).Value = "D"; cmd.Parameters.AddWithValue("@UpdatedBy", SqlDbType.Int).Value = Convert.ToInt32(hdfLoginId.Value); SqlParameter successParam = cmd.Parameters.Add("@Success", SqlDbType.Bit); successParam.Direction = ParameterDirection.Output; con.Open(); cmd.ExecuteNonQuery(); bool success = (bool)successParam.Value; if (success) { string message = Common.CommonFunction.recordDeletedSucessfully; ShowMessage("", message, "Success"); } else { ShowMessage("Oops...", success.ToString(), "error"); } GetData(); } } catch (Exception ex) { ShowMessage("Oops...", ex.Message, "error"); } } else { ShowMessage("Error", "Record Delete Failed, Please Try Again", "error"); GetData(); } } catch (Exception ex) { ShowMessage("Oops...", ex.Message, "error"); GetData(); } }
Thanks