Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Can View bag be used to pass message from one action to another. How?

user-image
Question added by Ubaid sayeed Mohd abdul sayeed , Senior Programmer , Moksha solutions
Date Posted: 2016/09/26

Use TempData or Session. TempData is actually a wrapper on Session. It would be something like thisthis.TempData["yourkey"] = yourData;Or in case of sessionthis.Session["yourkey"] = yourData;Difference is that data will be deleted form the session when read. (that's why its call temp data )ViewBag won't maintain data from action to action. 

More Questions Like This