Is something in the http protocol that will help me find out, or should I check the fields by myself.
If identical field values can be submitted more than once, should I add a dummy hidden field or something?
Is something in the http protocol that will help me find out, or should I check the fields by myself.
If identical field values can be submitted more than once, should I add a dummy hidden field or something?
One way you could do so is, disable the button using JavaScript once its clicked. Also, you can make a server side code which checks for multiple submits (or postbacks). I dont think there is anything available on the HTTP protocol as HTTP is stateless and doesnt know by itself about multiple submits.
I dont think its possible in http. you can calculate a hash of the fields and check it in javascript.
Edit you can store it in cookies
If you want to be completely sure you'll need to include a unique id for the form in a hidden field in the form, and check it against a data store all server threads can see (e.g. a db) before handling the form data.
One way to avoid this is to make a redirect to the same page after the occurrence of a postback action. But this will clear all your values stored in the ViewState.
Here is a good article on this subject
You can solve the problem on the client, on the server or both.
Client-side you can disable the submit button, show an alert box, redirect the user etc - have a look at this article.
Server-side you can use sessions and allow each visitor to submit only once.
I generally don't worry about extra loads/submits unless data is being saved/changed. As a result I put strong controls in the data modification logic. When loading the data I return the last change date and time of that data. When saving, I make sure that the existing data has the same exact last change date. the second save/change will be aborted because the first save will modify this last change date making it different. In the case of initial saving (INSERT) you can add logic to make sure that there has not been a new item created for the user within the last X time.