Reputation: 42444
Can I send tempdata to a redirected page? if yes how? if no, any alternative?
Upvotes: 6
Views: 5467
Reputation: 1627
TempData will persist for two jumps, while ViewData only persists for one. That is the simplest way I can explain it.
Upvotes: 1
Reputation: 24522
You can use TempData to persist data from one request to another when using Redirect()
and RedirectToAction()
This MSDN article explains it all.
If you want your page to display this data then you just need to pass it to your view from your action.
Upvotes: 10