title: How EditorFor set ID and Name html attributes on form elements
body: <p>I have few layers of nesting custom user controls:</p>
  
  <p>RegisterUser.aspx</p>
  
  <pre><code> &lt;%@ .... Inherit="System.Web.Mvc.ViewPage&lt;RegisterUserViewModel&gt;"
   ...
   &lt;%= Html.EditorFor(m =&gt; m.Details) %&gt;
   ...
  </code></pre>
  
  <p>UserDetails.ascx</p>
  
  <pre><code> &lt;%@ .... Inherit="System.Web.Mvc.ViewUserControl&lt;UserDetails&gt;"
   ...
   &lt;%= Html.EditorFor(m =&gt; m.BirthDate) %&gt; &lt;!--BirthDate is of type DateTime--&gt;
   ...
  </code></pre>
  
  <p>and I have declared DateTime.ascx in Shared/EditorTemplates</p>
  
  <pre><code> &lt;%@ .... Inherit="System.Web.Mvc.ViewUserControl&lt;dynamic&gt;"
   ...
   &lt;input type="text" id="???" /&gt;
   ...
  </code></pre>
  
  <p>The question is how to set input id attribute? I know that EditorFor makes some magic for default types. For example if DateTime was of type string, EditorFor will set id of input type to "Details_BirthDate" and the name attribute to "Details.BirthDate". I want to know how it's done? Because I want to use it for my special custom types.</p>