title: MVC DropDownListFor - Must I manually re-populate the options after validation fail?
body: <p>I have a viewmodel class which contains a couple of properties.  Basically, the current record (which the user is editing) and a list of options (which is used to populate a dropdown list using DropDownListFor).</p>
  
  <p>After the form is submitted, if the modelstate is not valid I return to the view.  I understand that the form is populated using the 'rejected' input from <code>ModelState["name"].Value.AttemptedValue</code>, but I'm not sure what to do about the list of values for the dropdown list.</p>
  
  <p>If I do nothing, on the validation fail and return to the page I get an 'object reference not set to instance of an object' error because the list property of the viewmodel is null.  I know that it's null because it wasn't bound from the form post, so I can repopulate it from the database before returning to the view.</p>
  
  <p>Is that the correct way to go about it, or am I missing a more obvious way of making the dropdown values persist?</p>