How do I prevent multiple form submission in .NET MVC without using Javascript?

后端 未结 13 2137
情深已故
情深已故 2020-11-28 02:36

I want to prevent users submitting forms multiple times in .NET MVC. I\'ve tried several methods using Javascript but have had difficulties getting it to work in all browser

13条回答
  •  温柔的废话
    2020-11-28 03:04

    You could include a hidden (random or counter) value in the form post, a controller could track these values in an 'open' list or something similar; every time your controller hands out a form it embeds a value, which it tracks allowing one post use of it.

提交回复
热议问题