Confirmation Message before Postback with Submit Button
When we are working with input forms, we will alert the user with a confirmation message before storing the data to the server.
From ASP.Net 2.0, we have a new property called ClientClick in server button control which can be utilized for this requirement.
Refer the code below,
The same thing can be achieved from code behind using ClientScriptManager class in ASP.Net 2.0.
ClientScript.RegisterOnSubmitStatement(this.GetType(),"confirm", "return confirm('Are you sure to proceed?')");
The above will code will give confirm box with OK and cancel button. Clicking OK will post the data to server while cancel will cancel the postback and will give the user to change the data in the input form.