I am trying to get a Yes No Prompt to show client side after an if statement in code, and depending on what the user clicks to execute code.
So far I have the following:
if (barcodes[t].ToString() == txtBarcode.Text)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>confirm('Item Already in Order, Continue?');</script>");
string confirmValue = Request.Form["confirm_value"];
if (confirmValue == "Ok")
{
itemAdd();
DBConnect.DisplayMessage(this, "Added to order");
}
else
{
DBConnect.DisplayMessage(this, "Not added");
return;
}
}
I envoke a script in the third line of the above code, which shows correctly.
However regardless of what the user chooses, it will always return negative.
Thanks in advance :)