How can I stop my form from being resubmitted in asp.net when the client clicks on the browser back button.
Asked
Active
Viewed 5,949 times
1
-
yes.. like clearing cookies or chache.. but still not working – S. S. Rawat Jul 27 '13 at 11:40
-
can you show me the code you have tried ? – zey Jul 27 '13 at 11:41
-
Session.Clear(); Session.Abandon(); Session.RemoveAll(); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1)); Response.Cache.SetNoStore(); – S. S. Rawat Jul 27 '13 at 11:43
-
The OP has posted a somewhat misleading question. They actually mean 'How do I stop form resubmission on browser back button being pressed'. Possible duplicate of http://stackoverflow.com/questions/2463843/asp-net-expiring-a-page-when-navigating-back – Paul Sullivan Jul 27 '13 at 12:13
-
possible duplicate of [Post Redirect Get in asp.net](http://stackoverflow.com/questions/5153018/post-redirect-get-in-asp-net) – OzrenTkalcecKrznaric Jul 27 '13 at 12:27
-
http://stackoverflow.com/questions/17905785/how-to-prevent-user-from-going-back-to-the-login-page-after-successful-login-usi here is another one of what you are seeking of – Alok Jul 28 '13 at 07:35
1 Answers
0
You can prevent the resubmission of a page redirecting the POST action to a GET one.
Keep a look in PRG Pattern and how implement it in C# if using MVC or try try this approach
![](../../users/profiles/1113510.webp)
Moesio
- 2,782
- 1
- 24
- 36