I have a .aspx form in which I have a combobox holding subject I retrive from a DB-table.
A submit button clicking on which questions related to that subject are viewed in a gridview.
I do it by calling the function FillGrid() in the button click event.
I also have pageindexchanging for my gridview in which FillGrid() is again called.
In my FillGrid() function I have used a try catch block. If an error occurs I want to redirect the page to error page using Response.Redirect(). The problem is this response.redirect is not working. One of the reasons of it is that on button click the form is posted twice. Because after reaching to response.redirect statement flow comes back to button click where FillGrid is called().
How can I solve this? Or to put simply, how can I prevent double posting of the form?
