开发者

data submission during form submission

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜