Skip to content Skip to sidebar Skip to footer

Confirmation Yes Or No Message In Asp Net

I have a problem to show confirm yes or no message box in asp.net. string script = 'alert(\'Insert success !!! \');'; ScriptManager.RegisterClientScriptBlock(this, GetType(), '

Solution 1:

You can create a confirm box in JavaScript by using: confirm().

You need to implement this code in your ASP.NET code.

if (confirm("Are you sure?")) {
  alert("OK");
} else {
  alert("BAD");
}

Try with this script:

string script = "if(confirm(\"Are you sure?\")){ alert(\"OK\");} else { alert(\"BAD\");}";
ScriptManager.RegisterClientScriptBlock(this, GetType(), "key", script, true); 

Post a Comment for "Confirmation Yes Or No Message In Asp Net"