What is a simple explanation for displayfor and displaynamefor in asp.net?
<p>I have a class</p>

<pre><code>public class Item
{
    public int ItemId { get; set; }

    [Required(ErrorMessage = "Category is required")]
    [Range(1, int.MaxValue, ErrorMessage = "Category is required")]
    public int CategoryId { get; set; }

    [Display(Name = "Current password")]
    [Required(ErrorMessage = "Name is required")]
    [StringLength(160)]
    public string Name { get; set; }

    [Required(ErrorMessage = "Price is required")]
    [Range(0.01, 100.00,
        ErrorMessage = "Price must be between 0.01 and 100.00")]
    public decimal Price { get; set; }

    public virtual Category Category { get; set; }
}
</code></pre>

<p>In my controller I pass an instance of this to view</p>

<pre><code>public ActionResult Index()
    {
        var model = new Item
        {
            CategoryId = 1,
            Name = "aaa",
            Price = 2
        };

        return View("Index", model);            
    }
</code></pre>

<p>then in view I try to display name using</p>

<pre><code>@model GenericShop.Models.Item

&lt;p&gt;                               
 @Html.DisplayNameFor(m =&gt; m.Name)                                       
&lt;/p&gt;
</code></pre>

<p>and get the following error</p>

<blockquote>
  <p>Compiler Error Message: CS1061:
  'System.Web.Mvc.HtmlHelper' does not contain
  a definition for 'DisplayNameFor' and no extension method
  'DisplayNameFor' accepting a first argument of type
  'System.Web.Mvc.HtmlHelper' could be found
  (are you missing a using directive or an assembly reference?)</p>
</blockquote>

<p><code>@Html.DisplayFor(m =&gt; m.Name)</code>  works fine, but I just cant see why </p>

<p><code>@Html.DisplayNameFor(m =&gt; m.Name)</code>  does not.</p>

<p><code>DisplayFor</code> displays the value for the model item and <code>DisplayNameFor</code> simply displays the name of the property?</p>