This is my code in .aspx file i write:
<%--
| Company Name: | |
| Burglary Policy Number : | |
| Burglary Cover Amount: | |
| Fire Policy Number : | |
| Fire Cover Amount: | |
| From Date : | |
| To Date : |
CommandArgument='<%# Eval("InsuranceId") %>' ImageUrl="~/Images/buttonedit.png" onclick="imgBtnshow_Click" />
ImageUrl="~/Images/1350368827_save_delete.png" onclick="imgBtnCancel_Click"/>
<%--ValidationGroup="Insurance"--%>
And i write this code in .aspx.cs file on imgBtnDelete_Click event:
protected void imgBtnDelete_Click(object sender, ImageClickEventArgs e)
{
string confirmValue = Request.Form["confirm_value"];
if (confirmValue == "Yes")
{
ImageButton btn = (ImageButton)sender;
Int64 Id = Convert.ToInt64(btn.CommandArgument);
InsuranceCompany obj = new InsuranceCompany();
obj.InsuranceCompanyId = Id;
int result = obj.InsuranceCompanyDelete(Id);
if (result > 0)
{
string popupScript = "$.prompt('Record Deleted Successfully.');";
ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "clientScript", popupScript, true);
fillgrid();
//Response.Redirect("~/Admin/InsuranceCompany.aspx");
}
}
}

Suraj Panigrahi26 reputationPosted Apr 24, 2018, 2:19 AM EDT
Deekshaa Singh Chauhan180 reputationPosted Apr 24, 2018, 2:22 AM EDT
Suraj Panigrahi26 reputationPosted Apr 24, 2018, 2:23 AM EDT