hello guys how r u ?
i am working on a project and creating the registration form but the problem is that when i click the submit button the data is being submit successfully but if i press the refresh button of the browser the same data is being submit in database again
so how can i over come on this bug in asp.net
kindly reply soon its urgent
Thanks.
Loading
Prabhu RajaPosted Oct 7, 2011, 1:58 AM
I suggest you to try the following code in Page_Load() Event :
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Or Try ,
-----------------------------------------------------------------------
If this post helps you, then Only mark as "Correct Answer"
Thank You
Faisal AnsariPosted Oct 7, 2011, 1:24 AM
Javeed M ShaikhPosted Oct 6, 2011, 1:45 PM
Why do you think the solution provided by Suthish is not logical?
Alternative ways is to prevent this at the database level by checking if this data already exist or by creating hidden/viewstate variable (datetimestamp) and compare this with Session variable (datetimestamp) on the server to see if request is same or different.
Please do not forget to mark "Accepted Answer".
Faisal AnsariPosted Oct 6, 2011, 5:23 AM
Suthish NairPosted Oct 6, 2011, 4:35 AM