I am using JavaScript confirm in an ASP.NET program, the confirm window works when I want it to, however I am not sure how to retrieve whether the user clicks 'OK' or 'Cancel'.
This is in the site master:
<script type="text/javascript">
var confirmMsg = document.getElementById('MainContent_confirmMessageHidden');
if (confirmMsg != null) confirm(confirmMsg.value);
</script>
This is in the aspx.cs file:
private void Confirm(string msg)
{
//Response.Write("<script language = 'javascript'>window.alert('" + msg + "')</script>");
confirmMessageHidden.Value = msg;
confirmMessageHidden.Visible = true;
}
How can I retrieve the choice of the user?