Persisting model state when using PRG
I’ve been working on an ASP.NET MVC application in which we frequently apply the Post/Redirect/Get pattern. One of the direct consequences of applying this pattern is that you often want to persist the model state across redirects, so that you don’t lose validation errors, or the values of input fields. To persist the model state across redirects, we can put TempData to work. The sole purpose of TempData is exactly this; persisting state until the next request. ...