What I'm trying to do is when the user tries to go to a different page inside a GridView control, I want to display JavaScript's confirm dialog box. If the user clicks on OK
then the page should change. If not the page should not.
What I've done at the moment is display the confirm dialog box when the GridView 's PageIndexChanging event is fired, but I can't seem to find a way to check which button was clicked on in the confirm dialog box and how to handle it.
Also, the GridView is inside an UpdatePanel and the ScriptManager.RegisterStartupScript
method is being used to display the confirm dialog box.