Is there any simple way to prevent form submission.
I have a page with a Fileupload control and a gridview. The file upload will upload an excel file. On Button click, all the records in excel will be saved to database and then , they are retieved to show in the gridview.
When user saves data, and then refreshes the button, the form resubmission prompt occurs. On clicking continue, the records in the excel are again saved to the database.
I tried setting fileupload1.dispose() to clear, but it still does it.
How can I prevent this.
Looking at the 'time technique' here, but want to know if there is a simpler way..
http://stackoverflow.com/questions/2283043/gridview-adds-duplicate-row-on-page-refresh/2283137#2283137 using c#. This is a sample how the flow is...
Page_load()
{
}
Button_Click
{
//if fileupload has file, save the data to gridview
......
bindgrid();
}
bindgrid()
{
//get data from database and show it in grid.
}