Search code examples
asp.net-mvcviewbag

how to keep value of viewBag asp.net mvc in view


i have 7 viewBags which holds data in view when the Page Reload (switch to another language ) the ViewBag value became empty

how to keep values of these viewBags after Page reload

i'm using asp.net mvc 5


Solution

  • ViewBag is just for passing from controller to view. You would want to use Session state if you want to persist data on post backs.