title: How do i reuse the expression from HtmlHelper.EditorFor
body: <p>In my cshtml file i have the following call</p>
  
  <pre><code>@foreach( var EducationPlan in Model.Fields) {
      @HtmlHelper.EditorFor(m =&gt; EducationPlan, "ViewFieldInputWithHidden")
  }
  </code></pre>
  
  <p>and in ViewFieldInputWithHidden.cshtml i have</p>
  
  <pre><code>@HtmlHelper.TextBox(Model.MemberName, Model.Value, Model.HtmlAttributes)
  @HtmlHelper.Hidden(Model.MemberName, Model.Value, new { id = Model.MemberName + "_Hidden" })
  </code></pre>
  
  <p>This gives me, with unimportant stuff removed</p>
  
  <pre><code>&lt;input id="EducationPlan_ResponsiblePerson" name="EducationPlan.ResponsiblePerson" type="text"&gt;
  &lt;input id="ResponsiblePerson_Hidden" name="EducationPlan.ResponsiblePerson" type="hidden"&gt;
  </code></pre>
  
  <p>Is there any way to emulate/use the same value as the TextBox uses to get the "EducationPlan" string with me when i write the id? Or is there, even better, just a way to append the "_Hidden" to the id.</p>
  
  <p>I found the solution and i'm leaving it here for other who runs into the same problem.</p>
  
  <p>Replacing the hidden with the following code helped:</p>
  
  <pre><code>@Html.Hidden(Model.MemberName, Model.Value, new { id = Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldId(Model.MemberName) + "_Hidden" })
  </code></pre>
  
  <p>So, basically the TemplateInfo class saves the expression in some way.</p>