title: ASP.Net MVC 2: How to keep values in the model between posts
body: <p>I have an edit view that is displaying some model properties as plain text and other model properties as input fields. My problem is that the model properties displayed as plain text are null when the model is returned to the view after a validation error.</p>
  
  <p>How do I retain the model values when I don't have input fields for all properties? What is best practice?</p>
  
  <p>My first thought is to keep the values of these properties in hidden input elements.</p>
  
  <pre><code>&lt;%= Html.HiddenFor(model =&gt; model.CustomerName) %&gt;
  </code></pre>
  
  <p>Is this considered a correct solution?</p>
  
  <p>Thanks
  Andreas</p>