To add a confirm popup when a button is clicked in asp .net do the following:
In the buttons OnClientClick add the following javascript:
if(confirm('Are you sure?'))
{
return true;
}else{
return false;
}
The confirm method returns a boolean.
The popup displays the message, an Ok button and a canel button.
If Ok is clicked return true allows the button to cause a post back.
Clicking cancel returns false cancel the submit action of the button.
Thursday, 23 October 2008
Subscribe to:
Post Comments (Atom)
1 comment:
Couldn't you just use
return confirm('Are you sure?');
Post a Comment