Is ViewData of MVC is equivalent to ViewState Webforms ?
No ViewData is a collection of information that is used by the Views in ASP.NET MVC. It's a way to pass additional data to a view that is more than the Model for the view contains. ViewData is not sent to the client, it is used by the server when processing the output to send to the client.
ViewState in WebForms is a way to maintain state between postbacks. ViewState is sent between the client and the server.
View state is stored on the client and sent back to the server with each request. It is used to add a form of state to your web application.
ViewData is not stored or sent to the client and is used by the server for processing. You can use it to send additional information to your view from the controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With