Posted By

Shurik76 on 06/04/10


Tagged


Versions (?)

Last Edited at 06/04/10 02:03pm

Viewed 3 times

Prevent Form Re-Submission on Page Refresh


/ Published in: ASP


  1. 'Use a hidden form field "RedirectAfterSubmission" with the URL in it as a value:
  2. 'For example: Request.ServerVariables("URL")
  3. 'As soon as post form data is received and processed (stored in cookies, DB etc.),
  4. 'use the following:
  5.  
  6. <%
  7. Response.Redirect(Request.Form("RedirectAfterSubmission"))
  8. %>
  9.  
  10. 'As a result page will be RE-requested by GET method instead of POST
  11. 'and refreshing the page won't cause it to re-submit the data!

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.