Davy
Davy

Reputation: 1063

Can anyone tell me if and why I should void using ViewData in ASP.Net MVC?

This has probably come before and is probably very subjective. I have been tols to avoid using ViewData and use a FromViewModel class to pass informaiton to the view istead.

Are there any major advantages of this approach?

Thanks

Davy

Upvotes: 0

Views: 95

Answers (1)

Jan Jongboom
Jan Jongboom

Reputation: 27342

ViewData is not strong typed, whilst Models are. So Models are less error-prone and more clear.

Upvotes: 2

Related Questions