Resolve | refresh | Web page | repeat | Repeat submit
Disable submit button after commit(Most people do this.)
What if the customer submits and presses F5 refresh?
Use session
Before the submitted page is the database processing:
If session ("OK") =true then
Response.Write "Error, submitting"
Response.End
End If
After the data is processed, modify the session ("OK") =false.
Data Processing success immediately redirect to another page
After the operation is really a problem, you can use the Jump page, close this page, if there are parameters according to the conditions to control, it should be good to do, you can directly modify the value of window.location, the parameters are all changed, so that is almost.
Disadvantage: Simply using Response.Redirect will no longer be effective, because the user from one page to another page, we must use the client code to clear the Location.history. Note that this method clears the last access history, not all the access records. Click the Back button, and then click the Back button, you can see that this is the page before the page opened! (Of course, this is under the condition that your client has JavaScript enabled.) )
What if the customer presses back?
prevent page back--Disable caching
When we do the database add operation, if we allow back, and happened to have refreshed the page, will be added again, no doubt this is not what we need, like the general online many prohibit caching code, sometimes unreliable, then you just in the operation of the page plus on it, in the page to specify the new page to be directed, Back again, see if it will not be back to the operation of the page, has actually been deleted this history
Asp:
Response.Buffer = True
Response.ExpiresAbsolute = Now ()-1
Response.Expires = 0
Response.CacheControl = "No-cache"
Asp. NET:
Response.buffer=true;
Response.expiresabsolute=datetime.now.addseconds (-1);
response.expires=0;
Response.cachecontrol= "No-cache";
How can I disable the browser's Back button? or "How to prevent users from clicking the Back button to return to a previously browsed page?" ”
Unfortunately, we cannot disable the browser's Back button.
prevent web pages from receding--new window open
Pop-up form page with window.open, click to close the page after submission, processing the submitted ASP page is also used to eject, set the target of the form, point submission window.open ("xxx.asp", "_blank"), and then use JS to submit the form, After completion window.close ();
Simply put, it is the time to submit the form to pop up a new window and close this window. How do I get back to the open window for window.open ()? Where can we go back?
Oh, wordy a pile of nonsense, know how to deal with it? Mix client script and server-side scripting.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.