my code-
else if (responseEntity.Messages[0].Description == ResponseMessages.DUPLICATE)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "javascript01", "hide('tblProductGrid');");
ShowDuplicateRecordAlertMsg("PROD", "Product");
txtAddProductName.Enabled = true;
}
private void ShowDuplicateRecordAlertMsg(string scriptName, string fieldName)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), scriptName, "window.setTimeout(\"alert('" + fieldName + " Already Exists.')\",0);", true);
}
Problem- my problem is that when duplicate record is found I am showing/hiding some panels and then alert comes that "Already exist." But now alert appears first on screen and when I click OK it run that show/hide script.so the problem is when alert box comes the background screen goes blank.How can I display my screen first and then alert box.