title: Strongly typed viewdata
body: <p>I created a strongly typed <code>LocationViewData</code> with a properties like</p>
  
  <pre><code>public Location location { get; set; }
  </code></pre>
  
  <p><code>Location</code> itself is model, with the properties <code>Address</code>, <code>Country</code>, and so on.</p>
  
  <p>In the controller I have:</p>
  
  <pre><code>public ActionResult Edit(int id)
  {
      LocationViewData ld = new LocationViewData();
      ...
      return View(ld);
  }
  </code></pre>
  
  <p>In the view codebehind I have:</p>
  
  <pre><code>public partial class Edit : ViewPage&lt;MvcTest.Models.LocationViewData&gt;
  {
  }
  </code></pre>
  
  <p>And my question is: how can I let the properties from a <code>Location</code> model in my <code>ViewData</code> to display in the appropriate textboxes, like:</p>
  
  <pre><code>&lt;%=Html.TextBox("address") %&gt;
  </code></pre>
  
  <p>I don't want to have to specify each field by its full name: </p>
  
  <pre><code>&lt;%=Html.TextBox("address", ViewData.Model.location.address) %&gt;
  </code></pre>