1

How can I stop my form from being resubmitted in asp.net when the client clicks on the browser back button.

Paul Sullivan
  • 2,847
  • 2
  • 17
  • 24
S. S. Rawat
  • 5,455
  • 3
  • 39
  • 58
  • 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 Answers1

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

Moesio
  • 2,782
  • 1
  • 24
  • 36