title: Displaying composite model items in Razor View using Html.Display and Html.DisplayFor in a foreach loop
body: <p>I'm a little confused about this.
  The ViewModel I'm passing over to the View Page contains two properties:</p>
  
  <pre><code> public class UserProfileViewModel
  {
      public ApplicationUser userProfile { get; set; }
      public AddressViewModel userAddress { get; set; }
  }
  </code></pre>
  
  <p>The AddressViewModel itself contains a List, whose items I want the View Page to display:</p>
  
  <pre><code>public class AddressViewModel
  {
      public int ID { get; set; }
      ......
      public virtual List&lt;GeoData&gt; GeoDataList { get; set; }
  }
  </code></pre>
  
  <p>Whew I try this on the Wiew Page</p>
  
  <pre><code>@model MySite.ViewModels.UserProfileViewModel
  ...
  @foreach (var item in Model.userAddress.GeoDataList)
          {
          &lt;dd&gt;
              @Html.DisplayFor(modelitem =&gt; item.PlaceName)
          &lt;/dd&gt;
      }
  </code></pre>
  
  <p>I correctly get exptected results
  But when I try to show the composite result that I need</p>
  
  <pre><code>@foreach (var item in Model.userAddress.GeoDataList)
          {
              &lt;dd&gt;
                  @Html.DisplayFor(modelitem =&gt; (item.PlaceName + ", " + item.PostalCode + ", " + item.Latitude + ", " + item.Longitude))
              &lt;/dd&gt;
          }
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <pre><code>Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
  </code></pre>
  
  <p>While when I try this:</p>
  
  <pre><code>@foreach (var item in Model.userAddress.GeoDataList)
          {
              &lt;dd&gt;
                  @Html.Display(item.PlaceName + ", " + item.PostalCode + ", " + item.Latitude + ", " + item.Longitude)
              &lt;/dd&gt;
          }
  </code></pre>
  
  <p>I get no exception and no result at all (blank page).</p>
  
  <p>Why is that?</p>