I have tried to check the best practices for using asp.net mvc and quite a few say that we should never use ViewData. I have read this post and it seems like it from that.
One reason that I can think of using ViewData is if you are looking to pass just one value to the view.But for more than one values it seems that it would better to use ViewModels. But if they are being included as a part of framework then they should have some advantages and benefits.
What are the cases when I should use ViewData ? What are the best practices to be followed when using ViewData so that it is not misused ?
I prefer to use strongly typed view models from the outset. I much prefer the lack of "magic strings" by doing this.
Never one rule for all situations but this is usually the first approach I take.