title: C# MVC: View with optional ViewModel (data not always present / necessary)
body: <p>I'm kind of stuck on an MVC problem.</p>
  
  <p>I have a registration view, reached by www.example.com/register, something like this:</p>
  
  <p><code></p>
  
  <pre><code>&lt;form id="registrationform" method="post"&gt;
  &lt;fieldset&gt;
      &lt;label for="emailaddress"&gt;Email&lt;/label&gt;
      &lt;input id="emailaddress" name="emailaddress" type="text" /&gt;
      //more inputs etc. 
  &lt;/fieldset&gt;
  &lt;/form&gt;    
  </code></pre>
  
  <p></code></p>
  
  <p>Now I allow people to invite others, so I'm checking in my controller's Register method for an invite parameter (www.example.com/register?invite=1234). If the invite parameter is not empty, I do a lookup in my database to get the associated "invited" user. That all works fine.</p>
  
  <p>Now the problem: I want to prepopulate my inputs with the data from the database. I already have the data, I just don't know about the best way to put it into the MVC view, and disable the inputs that are now already populated. </p>
  
  <p>ViewModel? Keep in mind that I need the view regularly empty (I don't want to use different views, that would violate DRY).</p>
  
  <p>Thank you :)</p>