write the following line of code and it should do your work
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:confirm('Do you want to move to other page?')", true);
Response.Redirect("Nextpage.aspx");
This code in any case redirects to the next page wheather the user has clicked on yes or no.
hope it gives you the solution.....