I have a .aspx form in which I have an object for selecting a list with a list that I retrieve from a DB table.
The submit button, clicking on which raises questions related to this object, in the form of a grid.
I do this by calling the FillGrid () function in a button click event.
I also have a pageview for my gridview in which FillGrid () is called again.
In my FillGrid () function, I used a catch try block. If an error occurs, I want to redirect the page to the error page using Response.Redirect (). The problem is that this response.redirect is not working. One reason for this is that when you click a button, the form is published twice. Because after reaching the response.redirect reaction, the stream returns to pressing the button where FillGrid () is called.
How can i solve this? Or just saying how can I prevent duplicate form posting?
source
share