In my asp.net application I have used JavaScript confirm box for user confirmation. Here is the code:
EDIT :
By using javascript confirm method you only decide, whether you want to continue or not - so it is ok that your Button1_Click method is called only when user clicks ok.
What you trying to do is quite different. I would suggest to get rid of ASP.NET Button control and use "common" HTML link like:
Click me
And then in javascript
document.getElementById('decideLink').onclick = function()
{
if(proceed) {
// do something here
} else {
// do something different
}
}
To call code-behind method from javascript, check this article about calling web methods from javascript