title: ASP.Net MVC 3 Razor Concatenate String
body: <p>I have the following in my ASP.Net MVC 3 Razor View</p>
  
  <pre><code>@foreach (var item in Model.FormNotes) {
  &lt;tr&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.User.firstName)
      &lt;/td&gt;
  &lt;/tr&gt;
  }
  </code></pre>
  
  <p>Which works fine, however, I would like to concatenate the string to display both the firstName and lastName, but when I try to do this</p>
  
  <pre><code>&lt;td&gt;
    @Html.DisplayFor(modelItem =&gt; item.User.firstName + @item.User.lastName)
  &lt;/td&gt;
  </code></pre>
  
  <p>I get the following error</p>
  
  <p><strong>Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions</strong></p>
  
  <p>Does anyone know how to concatenate a string in a Razor View?</p>
  
  <p>Thanks all.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>My Razor View accepts a ViewModel which looks like this</p>
  
  <pre><code>public class ViewModelFormNoteList
  {
      public IList&lt;Note&gt; FormNotes { get; set; }
  }
  </code></pre>
  
  <p>I would like to put the FullName property in here, as suggested by Roy, however, I am not sure how to get it working???</p>