Hi @Emeka Okoye,
You can create a popup message box called "yes/no" to prevent multiple submit buttons.
Demo
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type = "text/javascript">
function confirm_closing() {
var confirm_closingValue = document.createElement("INPUT");
confirm_closingValue.name = "confirm_closingValue";
if (confirm("Do you want to accept the closing?")) {
confirm_closingValue.value = "CONFIRM";
} else {
confirm_closingValue.value = "CANCEL";
}
document.forms[0].appendChild(confirm_closingValue);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="btnConfirm" runat="server" OnClick="OnConfirm" Text="Confirm" OnClientClick="confirm_closing()"/>
</form>
</body>
</html>
public void OnConfirm(object sender, EventArgs e)
{
string confirmValue = Request.Form["confirm_closingValue"];
if (confirmValue == "CONFIRM")
{
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('You clicked CONFIRM!')", true);
}
else
{
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('You clicked CANCEL!')", true);
}
}
Or design an UPDATE with a SELECT (untested):
Update AccTab
set AmtBal += @Amount
where UId = @UId
and not exists (select * from AccTab where AmtBal = (@Amount * 2));
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread