Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REFRESH problem after form submitted. 1

Status
Not open for further replies.

A1Pat

IS-IT--Management
Jun 7, 2004
454
US
Hi all,

I'm doing a feedback form exercise and having a little problem when submitting it, that is when I refresh the page (after submitted), the mail keeps sending to me even I'd alread clear up all fields manually. I even do a redirect that take me back to this page again after submitted, but no luck, and further more, a small message confirms user that his/her message was sent cannot be displayed when redirect technique is utilized. So, finally, I had to solve the problem by redirect to another page I'd like to call Confirm.aspx that will display the confirmed message, and the refreshed problem is... away.

Still, I would like to have this form to submit and re-display the original empty fields with the confirmed message. I think it'd be better!

Hope someone can help.
 
A Response.Redirect should work so maybe it was your implementation of it? What I would do is redirect back to the same page but append a querystring value on it so you can then check if the message was sent.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
This is how is redirect the page:

Me.Server.Transfer("feedback.aspx")

And somehow (with all the empty fields) the form keeps sending me email when I refresh it. I guess the code is incorrect, you think?

 
And, of course... the emails I received after refreshing the page is exactly the same with the one I submitted earlier (redirect or clear all fields technique)
 
It seems that you are right by using the Response.Redirect code, Mark. I have yet received any mail when refresh the page twice.

Thank you for the input... could you help me understand why the code Me.Server.Transfer("feedback.aspx") doesn't do the same?

Thanks again!
 
Server.Transfer calls the page from the server and pipes the output back to the client (but they think they are still on the same page as the URL will stay the same). A Response.Redirect will cause the browser to request the page again so are far as you are concerned, it's like the user is visiting a page for the first time (i.e. no postback).


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top