This is very easy to accomplishmyButton.Attributes["onclick"] = "return confirm('Are you sure you want to save the data?')";This will cancel the click event if you press no. Pressing yes will potback the page.