The most basic way to pass data from the controller into the view is through the use of magic strings and a convenient dictionary called
ViewData. In this recipe, we will see how to use this easy, but dangerous, duo to shuttle data out to the far edges of our presentation layer. We will then take a quick look at why the use of magic strings and the
ViewData container put us in a fragile state and should be kept away from, if at all possible.
Magic Strings? A magic string is a string that represents an object or a block of code within your source. An example of this is when referencing an action or controller name in a link. As the name of the action is string-based, refactoring the action method ...