6

Can I send tempdata to a redirected page? if yes how? if no, any alternative?

David Glenn
  • 24,412
  • 19
  • 74
  • 94
coure2011
  • 40,286
  • 83
  • 216
  • 349

2 Answers2

10

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.

David Glenn
  • 24,412
  • 19
  • 74
  • 94
  • 4
    Sorry @David the link is no longer working, could you please update? Thank you. – TJB Jan 02 '13 at 23:13
1

TempData will persist for two jumps, while ViewData only persists for one. That is the simplest way I can explain it.

esastincy
  • 1,607
  • 8
  • 28
  • 38