javascript code:
<script language="javascript" type="text/javascript">
function ConfirmOnDelete(SIMCODE) {
if (confirm("Are you SURE you want to Delete") == true) {
window.location = "del.aspx?SIMCODE=" + SIMCODE + "&DOIF=" + 7;
return true;
}
The javascriopt code is redirecting me to the del.aspx page with query string. where i'm performing delete function, u can c delete function after button code.
button code:
<button id="btndel" value="Delete" class="btn btn-danger" placeholder="Delete" onclick="ConfirmOnDelete('<%# Eval("MobileNo") %>')">Del
</button>
Delete function on del.aspx page onload.
protected void Page_Load(object sender, EventArgs e)
{
doif = Convert.ToInt32(Request.QueryString["DOIF"]);
if (doif == 1)
{
rec = Request.QueryString["ORDCODE"].ToString();
rec_id = Convert.ToInt32(rec);
dl.DeleteCompany(rec_id);
Response.Redirect("CompanySetup.aspx");
}
}
plz let me know, if u get it.
its working good in all my projects.