Well, I have no convincing evidence that the viewBag or ViewData is stored on the server / client, but they will definitely be stored in the serverโs memory, and not on the client.
First of all, no, where do you see what people say about their storage even in the MSDN documentation; unlike ViewState in ASP.NET , where the MSDN document clearly shows that it is stored on the client side.
Secondly, since ViewState stored on the client side; it uses a hidden field ( __VIEWSTATE ) to store viewstate data on the client side.
Continuing this, if the ViewData or viewBag also has the same mechanism, then viewing the source of the page could highlight it, but it does not display that size.
Saving in cookies is never an option, as you can never make sure that it is enabled or not on the client side.
Also, do you really need to save to the server / client? The reason that both the viewBag and the ViewData are displayed is viewBag out after viewing the view in the browser. Then I see no reason to store them, unlike ViewState for requesting the next page.
Just a thought after some research.
source share