iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Reply
 
LinkBack (1) Thread Tools
Old October 6th, 2005, 05:51 AM   1 links from elsewhere to this Post. Click to view. #1
New Member
 

Join Date: May 2005
Location: bath - england
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 simonneaves is on a distinguished road
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
simonneaves is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 8th, 2005, 12:09 PM   #2
Most Reputable Member
 
spinal007's Avatar
 

Join Date: Mar 2004
Location: Good Ol'London
Age: 24
Posts: 1,683
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Rep Altering Power: 0 spinal007 has a spectacular aura about spinal007 has a spectacular aura about
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>
__________________
Diego - Web-Developer & London SEO Expert
jQuery Plugins: Multiple File Upload, Star Rating, FCKEditor | NEW: XML to JSON
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 10th, 2005, 06:04 AM   #3
New Member
 

Join Date: May 2005
Location: bath - england
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 simonneaves is on a distinguished road
aha!
good thinking. I'll give it a go.

Cheers.
simonneaves is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
prevent , refresh , asp


LinkBacks (?)
LinkBack to this Thread: http://webforumz.com/classic-asp/3402-prevent-refresh-in-asp.htm
Posted By For Type Date
Prevent Refresh of whole page - ng.asp-net-forum.dotnetnuke - fix error problem @CodeVerge This thread Refback November 7th, 2008 07:45 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent multiple instances of web page duncanwill JavaScript 2 May 21st, 2008 05:16 AM
How to stop the browser refresh on clicking the webbrowser's refresh button ? camarun20 JavaScript 3 March 18th, 2008 09:04 PM
prevent line break after a checkbox pesho318i HTML, XHTML and CSS 7 February 6th, 2008 06:34 AM
Prevent injection MSSql server ktsirig Databases 0 October 16th, 2007 05:58 AM
Prevent special character in username marSoul PHP 3 September 19th, 2007 10:55 AM


Search Engine Optimization by vBSEO 3.2.0 RC8