title: Why does a hidden input lose my view model's property value?
body: <p>When I use the following Razor markup to try and send my <code>PageCount</code> value to the client, the value of the input is rendered as 0:</p>
  
  <pre><code>@using (Html.BeginForm("Index", "Gallery", FormMethod.Post, new { id = "search-form" }))
  {
      @Html.HiddenFor(m =&gt; m.PageCount)
  </code></pre>
  
  <p>This renders as follows, despite <code>PageCount</code> having a value of 2:</p>
  
  <pre><code>&lt;input data-val="true" data-val-number="The field PageCount must be a number." data-val-required="The PageCount field is required." id="PageCount" name="PageCount" type="hidden" value="0"&gt;
  </code></pre>
  
  <p>When I fall right back on nearly all plain ol' HTML, like this:</p>
  
  <pre><code>&lt;input type="hidden" name="PageCount" id="PageCount" value="2"&gt;
  </code></pre>
  
  <p>Is there some funny behaviour with Razor w.r.t. hidden inputs, or what?</p>