title: ASP.NET Core MVC add/remove dynamic content
body: <p>I'm currently developing a system which manages work times and analyze them. Therefore I need to add several <em>Time-Stamps</em> once and add/remove some input field dynamically.</p>
  
  <p>The ViewModel looks like:</p>
  
  <pre><code>public class CreateWorkDayViewModel
  {
      public DateTime Date { get; set; }
      public IEnumerable&lt;CreateStampModel&gt; Stamps { get; set; }
  }
  
  public class CreateStampModel
  {
      public string ProjectId { get; set; }
      public DateTime From { get; set; }
      public DateTime To { get; set; }
  }
  </code></pre>
  
  <p>How to do this with the razer syntax including validation?</p>
  
  <p>I'm developing with Visual Studio Version 15.2 and the latest stable MVC version.</p>
  
  <p><strong>EDIT (17.05.17):</strong><br>
  <em>What I've done so far:</em>  </p>
  
  <p>I added a jQuery based mechanism to add/remove rows dynamically.<br>
  <a href="https://bootsnipp.com/snippets/featured/dynamic-table-row-creation-and-deletion" rel="nofollow noreferrer">Click for the mechanism</a><br>
  My problem is, that in the part of where I'm adding the rows(at JS line 4) I can't use the razor syntax because this html code is inserted at runtime by jQuery.<br>
  I also tried it with the old way and used instead of <code>asp-for</code> <code>name</code>. This works for the post data, but to fill the project drop-down selection I need the data from the ViewModel and this is missing.</p>