February 2019
Beginner
694 pages
18h 4m
English
The View in MVC represents the visual representation of a Model. In web frameworks, this would typically be a snippet of HTML, as follows:
<div id="viewTemplate">
<span><b> {Id} </b></span>
<span><h1> {DisplayName} </h1></span>
</div>
Here, we have an enclosing div that contains two spans. The first span is rendered in bold, and will display the Id property from the model. The second span is rendered in h1 style, and displays the DisplayName property from the model.
By separating the view elements of a user interface from the model, we can see that we are free to modify the view as much as we like, without even touching the code for the model. We could apply styles to each element through CSS, or even hide certain properties from ...
Read now
Unlock full access