What is the Exact use of DisplayFor
in mvc razor view? Because it will show only string that matches the model property we pass. But in Razor view, we can directly show the property value using model.propertyvalue
What is the difference between below codes,
<span> @Html.DisplayFor(m => m.propertyValue)</span>
VS
<span> @Model.propertyValue</span>