How to prevent browser from displaying alert and resending previous information?

0

Work in a .aspx WEB application that writes data to the database. The problem is that after writing this data and displaying a success information for the user, if I do a reload on the page the browser will send the information back to the server that will again write to the bank. How can I avoid this?

    
asked by anonymous 16.12.2014 / 18:08

1 answer

2

You can check if it's a postback, if so you can redirect it to another page

if(IsPostBack) {
Response.Redirect("https://pt.stackoverflow.com/");
} else {
//Salva dados.
}

Take a look: link

    
16.12.2014 / 18:10