i have a form which has two textboxes and a submit button. on entering data and submitting data gets sto开发者_StackOverflow中文版red in the database.but if i again refresh the page the same data again gets stored. How should this be prevented?
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.
You should implement a PRG redirect to a confirmation / thank you page.
精彩评论