They're one and the same, and you could use ViewData.ModelState.Errors
in your controller - having it as a property on ControllerBase
is really just a convenience, allowing you to shorten it to ModelState.Errors
(and the even more often used ModelState.IsValid
).
Although the main use of ModelState
from an "end developer"'s perspective is in the controller, ViewData
is used as a container for all data that's communicated between the controller and the view. Which is why it also needs to include ModelState
- because, although you'd rarely use it directly in the view, ModelState
is where e.g. many of the HtmlHelper methods actually get the values from by default when rendering the view from a POST action - rather than Model
.