title: Why mvc Html.HiddenFor does not render my field?
body: <p>I'm trying to do this simple thing</p>
  
  <pre><code>&lt;%= Html.HiddenFor(model =&gt; model.Id)%&gt;
  </code></pre>
  
  <p>the model is </p>
  
  <pre><code>[HiddenInput(DisplayValue=true)]
  public int Id { get; set; }
  </code></pre>
  
  <p>but i always get this rendered</p>
  
  <pre><code>&lt;input type="hidden" value="0" name="UserInfo.Id" id="UserInfo_Id"&gt;
  </code></pre>
  
  <p>i've check and the id is NOT 0.. ?!</p>
  
  <p>need some explanation here...</p>
  
  <p>Edit </p>
  
  <p>The problem seem's to be the post thing mentionned below.
  This is working </p>
  
  <pre><code>&lt;input type="hidden" value="&lt;%= Html.AttributeEncode(Model.Id) %&gt;" id="&lt;%= Html.IdFor(model=&gt;model.Id)%&gt;" name="&lt;%= Html.NameFor(model=&gt;model.Id)%&gt;" /&gt;
  </code></pre>
  
  <p>Thanks to Manaf </p>