title: How do I create a MVC Razor template for DisplayFor()
body: <p>I have a couple of properties in my view model that are display-only but I need to retrieve their values using jQuery to perform a calculation on the page. The standard <em>Html.DisplayFor()</em> method just writes their value to the page. I want to create a razor template that will allow me to render each element as:</p>
  
  <pre><code>&lt;span id="ElementsId"&gt;Element's value&lt;/span&gt;
  </code></pre>
  
  <p>I know I can specify a template in <em>Html.DisplayFor()</em> to use a particular template for rendering the property but within that template how do I identify the <em>id</em> attribute to write into the <em>span</em> tag?</p>
  
  <pre><code>@Html.DisplayFor(model =&gt; model.Element, "MyTemplate");
  </code></pre>