Posted By

Shurik76 on 06/04/10


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

asifrizvigmailcom
wizard04
nickian


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  

You need to login to post a comment.