This is a discussion on "prevent refresh in asp" within the Classic ASP section. This forum, and the thread "prevent refresh in asp are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
prevent refresh in asp
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
prevent refresh in asp
Hi I have a page which submits an email (amongst other things). If the user refreshes the page, the email is sent again.
Is there a bit of asp script which will block any attempts to refresh a page? Thanks |
|
|
|
#2
|
||||
|
||||
|
I'm assuming your page is something like this:
<% ' process submitted info ' ............. commands, send email, etc ' if processed submitted info, show confirmation ' .......... confirmation %> <form action="<%=Request.ServerVariables("SCRIPT_NAME")% >" method=post>[/b] if so, do what I do: instead of displaying the confirmation just after the processing, redirect to the same page (without the form data) and then display confirmation. that way, even if they user refreshes the page, no data has been submitted. example: <% If Request.QueryString("action")="submit" Then ' process submitted info ' ............. commands, send email, etc response.redirect "?action=confirm" End If If Request.QueryString("action")="confirm" Then ' if processed submitted info, show confirmation ' .......... confirmation Response.End End If %> <form action="?action=submit" method=post>
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#3
|
|||
|
|||
|
aha!
good thinking. I'll give it a go. Cheers. |
![]() |
| Tags |
| prevent, refresh, asp |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Prevent multiple instances of web page | duncanwill | JavaScript Forum | 2 | May 21st, 2008 08:16 |
| How to stop the browser refresh on clicking the webbrowser's refresh button ? | camarun20 | JavaScript Forum | 3 | Mar 18th, 2008 23:04 |
| prevent line break after a checkbox | pesho318i | Web Page Design | 7 | Feb 6th, 2008 09:34 |
| Prevent injection MSSql server | ktsirig | Databases | 0 | Oct 16th, 2007 08:58 |
| Prevent special character in username | marSoul | PHP Forum | 3 | Sep 19th, 2007 13:55 |