It doesn't seem like a better approach (I mean, you can display a pop-up client application) ... However, if you want to execute this ...
You have a hidden asp button: on your aspx and attach an event handler to it and write the code that you want to execute by clicking the "Yes" button on the confirmation button.
And change your RegisterStartupScript below
type= ClientScript.RegisterStartupScript(typeof(Page), "exampleScript", "if(confirm('are you confirm?')) { document.getElementById('btn').click(); } ", true);
source
share