Prevent resending information on refresh
-
Hi, I have an asp.net page with a send button. when I hit that button, I send some information to the DataBase. When I try to refresh the page I'm asked to resend the inforamtion or to cancel the refresh. as a result, I get multiple rows in the database... how can I refresh the page and prevent the resending of the info?
Why u want to refresh the page? If u are doing this to clear form fields, then u can do it in send button itself. If there is any specific reason then above solution is good one. :)
-
create one primary key in that database so that it will return eror message that duplicate column, capture that error and throw user friendly error message....... [or] disable refresh and f5 button....
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
modified on Tuesday, August 25, 2009 8:00 AM
-
I don't think it's a right solution for my problem. I want to allow users send some duplicate info, but I dont want it to happen automatically when they refresh the page.
why do you want to refresh the page... any specific reason or any requirement......
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
Hi, I have an asp.net page with a send button. when I hit that button, I send some information to the DataBase. When I try to refresh the page I'm asked to resend the inforamtion or to cancel the refresh. as a result, I get multiple rows in the database... how can I refresh the page and prevent the resending of the info?
You can actually target submission into an IFRAME through an intermediate handler page. The response back from the handler page, manipulated by a JavaScript function can control the response. That way you get to show some progress of submission of the form as well.
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep! -
Hi, I have an asp.net page with a send button. when I hit that button, I send some information to the DataBase. When I try to refresh the page I'm asked to resend the inforamtion or to cancel the refresh. as a result, I get multiple rows in the database... how can I refresh the page and prevent the resending of the info?
-
Hi, I have an asp.net page with a send button. when I hit that button, I send some information to the DataBase. When I try to refresh the page I'm asked to resend the inforamtion or to cancel the refresh. as a result, I get multiple rows in the database... how can I refresh the page and prevent the resending of the info?
benams wrote:
how can I refresh the page and prevent the resending of the info? Quote Selected Text
By redirecting to a page. When you redirect, browser will clear the post data from it's cache.
Navaneeth How to use google | Ask smart questions
-
benams wrote:
how can I refresh the page and prevent the resending of the info? Quote Selected Text
By redirecting to a page. When you redirect, browser will clear the post data from it's cache.
Navaneeth How to use google | Ask smart questions
-
benams wrote:
I mean when the user hit the refresh button of his web browser..
You can restrict user to click on Refresh Button on Browser. The think you need to do is you have to check the Post back of Page. On
Page Load
,If(Page.ISPostBack)
{
// Store Db data into Database.
}And After that
Reset
All the field.Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
Hi, I have an asp.net page with a send button. when I hit that button, I send some information to the DataBase. When I try to refresh the page I'm asked to resend the inforamtion or to cancel the refresh. as a result, I get multiple rows in the database... how can I refresh the page and prevent the resending of the info?
Please read my last reply in this thread for Answer.
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
Hi, I have an asp.net page with a send button. when I hit that button, I send some information to the DataBase. When I try to refresh the page I'm asked to resend the inforamtion or to cancel the refresh. as a result, I get multiple rows in the database... how can I refresh the page and prevent the resending of the info?
I created a new class that my page inherits from that basically adds a session variable and a form field and then tracks the two to see if the user hit the F5 button. There is a article on it here in code project somewhere (I didn't create the original, but modified to fit my needs), I just can't seem to find the link. You could also look at other solutions like. http://aspalliance.com/687_Preventing_Duplicate_Record_Insertion_on_Page_Refresh.4[^] and http://forums.asp.net/t/763984.aspx?PageIndex=2[^]