In my code, I am attempting to display a Yes/No prompt on the client side after an if statement is executed. Depending on the user's choice, corresponding code should be triggered.
Here is what I have so far:
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 am using a script in line three of the above code, and it displays correctly.
However, regardless of the user's choice, it always returns negative.
Thank you in advance :)