You have Button
No matter what you click OK or Cancel, it does a normal postback, as if cross-page postbacks wouldn't exist. Why?
Answer:
Well, cross-page postbacks are implemented using javascript. And when you put return statement like that it ends up into onclick of the rendered button. For example Button like this
renders As you can see, this effectively prevents rest of the postbacking script from functioning since whatever confirmation box returns, it won't let postback options to be set and therefore prevents cross-page postbacking from working.
Answer is to change confirm check so that it returns only when user click Cancel.
Put the OnClientClick as
OnClientClick ="if ( !confirm('OK?') ) return false;"
Then the rendered onclick attribute changes
onclick="if ( !confirm('OK?') ) return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button2", "", false, "", "Default4.aspx", false, false))"
And you should be good to go.
Trovato qui.