What is the difference between viewstate and viewdata in mvc?
A:
Hello,
ViewState and ViewData can handle some complex objects.
ViewState is within page lifecycle while ViewData works in very different way. ViewData can be passed to the target view.
Please refer here for understanding of viewState: http://msdn.microsoft.com/en-us/library/ms972976.aspx
for viewData: http://www.asp.net/mvc/tutorials/asp-net-mvc-views-overview-cs
hope that helps
samer
2010-09-01 12:17:41
A:
View state is used only in ASP.net forms,controls and Page life cycle. View state is used by ASP.net framework to manage control states.
View Data is a dataset or Data which is passed to your View - to dipslay HTML data in MVC,
Viewstate is not used in MVC. Please refer above mentioned links for more details.
swapneel
2010-09-01 12:26:45
http://www.asp.net/mvc/tutorials/asp-net-mvc-views-overview-cs http://msdn.microsoft.com/en-us/library/ms972976.aspx
swapneel
2010-09-01 14:06:24