title: Attaching a hidden text field to a form MVC
body: <p>This very well may end up being a very silly question in a way but basically I have this "form" in a model that gets attached to my View as the form but I haven't been able to actually pass any data do it from the View.  It only has two properties: an Id property and a String property.  I've been trying to fill the String property with text from a hidden text box on the page with no luck.</p>
  
  <p>Form code:</p>
  
  <pre><code>    public class AllocateListForm
  {
      public int Id { get; set; }
  
      public virtual string HiddenText { get; set; }
  }
  </code></pre>
  
  <p>Relevant View code:</p>
  
  <pre><code>  &lt;% using (Html.BeginForm("SaveExit", "User", new { }, FormMethod.Post, new { id = "selectExitPoints" }))  { %&gt;
      &lt;fieldset&gt;
              &lt;input type="hidden" id="HiddenText" /&gt;
      &lt;/fieldset&gt;
    &lt;% } %&gt;
  </code></pre>
  
  <p>There is JQuery behind the scenes that fills <code>HiddenText</code> with text and I can assure you that it is filling.  There is also JQuery behind the scenes that performs an Ajax submission and I can promise you that code works as it is used elsewhere in the application without a problem.  When I perform the action that submits the form to the server and I go to my controller code that this points to, I have a breakpoint set so I can go into the console and check if the HiddenText field on the form has any data it is null.  Can anybody point me in the right direction?  </p>