Posted August 19th, 2017.
In case you want to keep variables between page requests, ASP.NET CORE MVC and ASP.NET MVC provides a more elegant solution than the classic ViewState. It is called TempData. The usage of it is pretty straightforward. The example from below shows how I assign a variable to preserve the sort state of a column in a list table:...