Javascript confirm popup in ASP.NET

Q & AJavascript confirm popup in ASP.NET
Admin Staff asked 4 years ago

Javascript confirm popup in ASP.NET

1 Answers
Admin Staff answered 4 years ago

To display confirm box in asp.net by using javascript use below code to display confirm box and select ok or cancel button
< script type=”text/javascript” >
function ConfirmMessage()
{
  var result = confirm(‘select Ok or Cancel’);
  if(result)
   {
    document.GetElementById(”<%=Button1.ClientID%>”).click();
   }
}
< /script>