Hi ,
You can use in this way
----Source---
<form id="form1" runat="server">
<div>
<asp:Button ID="btnOpenConfirm" runat="server" Text="Open Confirm" OnClick="btnOpenConfirm_Click" />
<asp:Button ID="btnOkClick" runat="server" Text="Execute Code On OK" OnClick="btnOkClick_Click" />
</div>
</form>
---code behined-----------
protected void btnOpenConfirm_Click(object sender,EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(),
"OpenConfirm", "if(confirm('Are you sure you want to delete?')){document.getElementById('btnOkClick').click(); };", true);
}
protected void btnOkClick_Click(object sender, EventArgs e)
{
Response.Write("Deleted");
}
Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator