Refresh Page on Back Click - MVC 4

前端 未结 3 665
南旧
南旧 2021-02-04 14:19

What would be a simple way to force my ActionResult to always fire when I hit this page? On browser back click, for instance, this will not execute.



        
3条回答
  •  难免孤独
    2021-02-04 15:01

    Adding this code to my HTML works just fine for me:

    
    
    

    This might come handy for those who prefer not to deal with server side code as opposed to the accepted solution.

    All it does is assign a value to a hidden input on first load which will remain on the second load in which case the page is force refreshed.

提交回复
热议问题