title: Getting full property name using ModelMetadata
body: <p>I'm trying to create an HtmlHelper that will create Bootstrap-compatible form fields. My first goal was to create an HtmlHelper that will create the surrounding div:</p>
  
  <pre><code>&lt;div class="control-group"&gt; ... &lt;/div&gt;
  </code></pre>
  
  <p>Following the excellent advice here and also here I managed to get it to work relatively quickly. But it doesn't always work.</p>
  
  <p>I have a ViewModel with a complex property, so in my form I access the field <code>m=&gt;m.Complex.Element</code> . In my helper I check the element for validation errors. I use <code>ModelMetadata.FromLambdaExpression(expression, html.ViewData)</code> . The metadata I get back has the property name <code>Element</code>, and not <code>Complex.Element</code>.</p>
  
  <p>When I check the ModelState for this property, I can't find it, because the ModelState keeps the full name - <code>Complex.Element</code>.</p>
  
  <p>I can look for partial matches, hoping there's no other Element, but that seems like a nasty bug waiting to happen. How can I get the full property name from the expression?</p>