You can do this in many ways:
One of them places a button on the page, makes it display: none, and when true is confirmed, start its click with js.
Like in aspx
<asp:Button runat="server" ID="btnSaveData"
onClick="btnSaveData_Click" style="display:none;" />
on the client side, create a js function to call up a confirmation dialog, e.g.
function ConfirmSave()
{
if(confirm('Record already exist.Do you want to proceed?')
{
jQuery("[ID$=btnSaveData]").click();
}
}
in the code below
Code verification in some event handler
if (check == true)
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script",
"ConfirmSave();", true);
}
bthSaveData click handler to save data.
protected void btnSaveData_Click(object sender, EventArgs e)
{
}
source
share