you might consider adding the ASP.NET tag to your ASP.NET questions, that's what the tags are for.
your code cannot work. It will show this popup after a postback for a start, which is hardly efficient. It also doesn't check the return value of the confirm call, therefore it always does the same thing. Is it possible to do this check on the client side, you can add an OnClientClick event to a button and if it returns false, the postback will not occur.