문제

I used TempData to pass data from an action to another,but when i refresh the page the value of TempData becomes null, how I can solve this probleme? Thanks,

도움이 되었습니까?

해결책

Use Session instead of TempData. TempData is supposed to be used only for a single redirect. Another possibility is to call the Keep method inside the controller action in which you are consuming the value from TempData. This way if the user refreshes the page by hitting F5 TempData will be persisted for one more request.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top