ASP.NET MVC does browser refresh make TempData useless?

前端 未结 6 1174
逝去的感伤
逝去的感伤 2020-12-29 15:20

If I redirect to a new page passing TempData to initialise the page it works fine, however if the user presses the refresh button in their browser the TempData is no-longer

6条回答
  •  北海茫月
    2020-12-29 16:14

    A workaround for the the given situation in MVC1 would be to re-assign the TempData in the second controller as well. Of course it persists the data in the system for a bit more time. but it fixes the refresh issue.

提交回复
热议问题