On click of the save button, I have to check whether the inventory item exists for the store. If exists then, I have to ask the user whether the user want to use the same item that was already deleted. I am trying to achieve this with the following code. I am having this code in the save button click. I am strugling with geting the result from the confirmation box[Yes/No]. It is not showing the confirmation box immediately after executing this code. so hidden1.value is empty. Can you please help me?
string Script = "<script language='JavaScript'>document.getElementById('" + Hidden1.ID + "').value =confirm('This Item was previously deleted. Would you like to undelete the item ?'); GetPostBackEventReference(Hidden1, string.Empty);</script>";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "AskBringBackConfirm", Script);
if (Hidden1.Value == "true")
{
}
else
{
valCustomValidator.ErrorMessage =
"Please enter an item number other than <b>[" + txtItemNumber.Text
+ "]</b>.</br>";
valCustomValidator.IsValid = false;
}