I want to show the confirmation window in asp.net from the server side:
I want to call it from the server side because I need to send a client message from the server. I am using the code below
string str = "Are you sure, you want to Approve this Record?";
ClientScript.RegisterStartupScript(typeof(Page), "Popup", "return confirm('" + str + "');",true);
Now it displays a pop-up window and no matter what I click, “ok” or “Cancel”, my code is executed.
Please let me know how I can limit code execution when the user selects "cancel" in the confirmation field.
source
share