coure2011
coure2011

Reputation: 42444

TempData to redirected page?

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

Upvotes: 6

Views: 5467

Answers (2)

esastincy
esastincy

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

David Glenn
David Glenn

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

Related Questions