I've been reading the Professional ASP.NET MVC 1.0 book as well as reading other sources talking about using ViewModel instead of ViewData from within your controllers to Views. But then I see so many examples of ViewData being used in scenarios that are tough where there's no other way but to get something from ViewData. But then I read a book like Pro ASP.NET MVC Framework and all he talks about is only ViewData, nothing about ViewModel. So is ViewModel a very new concept or what?
I see that ViewModel is a much better approach but is it a solid alternative? I mean ViewData is so readily available to you in other things such as the HtmlHelper object where ViewModel is not. Or for example using it in a custom control (http://www.codeproject.com/KB/custom-controls/MVCCustomControls.aspx). So do I use a combo of both depending on different goals or what? What if I want to access the ViewModel in my Extension method for whatever reason? I'm lost here as to what path to take. I know that ViewData is not strongly typed but that you can set your view to specify the type and therefore make your ViewData typed but I just wonder. There is so much support for ViewData but I know ViewModel is a much more abstract and separated way to go as well as it being typed. I just don't want to cut myself short in scenarios where I will need to grab certain data such as the ViewData that is readily accessible from other objects such as the HtmlHelper class.
Thoughts? Standards? Experiences? Am I off a bit or do you just use a combo and still use ViewData in other circumstances than just sending data from your Controller to your View or what?
And If you're not using ViewData at all and instead using ViewModel with your controllers, it seems like an all or nothing in that you are using ViewModel and therefore ViewData has no purpose since you have not set it in with anything from your controllers so it has no use at that point?? Am I confusing anyone or way off here? Confusing the hell out of myself that's for sure.