tags:

views:

18

answers:

3

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
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