i have a form which has two textboxes and a submit button. on entering data and submitting data gets stored in the database.but if i again refresh the page the same data again gets stored. How should this be prevented?
A:
You should implement a PRG redirect to a confirmation / thank you page.
Nev Stokes
2010-10-30 12:18:39
A:
One way to solve this common problem is to redirect to another ActionResult, where you inform of the success/failure of the form submission.
Also, try to submit a ViewModel instance (see strongly typed views), not form values. That simplifies data validation.
ovm
2010-10-30 12:21:39
+1
A:
just go through this link: http://aspalliance.com/687_Preventing_Duplicate_Record_Insertion_on_Page_Refresh.4
andrew Sullivan
2010-10-30 13:29:48