Return value of javascript confirmation popup button click.
- Puts value into textbox to be reviewed in code behind to verify which button was clicked.
<input type=”hidden” id=”AnsTextBox” runat=”server” />
<script language=”javascript” type=”text/javascript”>
function getVerify() {
var agree = confirm(“Do you want to delete this row?”);
if (agree)
document.getElementById(‘<%=AnsTextBox.ClientID%>’).value = ‘True’;
else
document.getElementById(‘<%=AnsTextBox.ClientID%>’).value = ‘False’;
}
</script>
Do this ‘OnClientClick’ event.
Check for the value of Hidden field in Code behind in the ‘OnClick’ event. Chimple..






