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");
}
}
}
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Deekshaa Singh ChauhanPosted May 2, 2018, 2:26 AM
Suraj PanigrahiPosted Apr 24, 2018, 8:48 AM
Suraj PanigrahiPosted Apr 24, 2018, 6:23 AM
Deekshaa Singh ChauhanPosted Apr 24, 2018, 6:22 AM
Suraj PanigrahiPosted Apr 24, 2018, 6:19 AM