title: MVC "create view" when there is one to many relationship in model
body: <p>My model is simple, one client can have many phone numbers :</p>
  
  <p>I have represented this in Entity Framework<img src="https://i.stack.imgur.com/oX2bf.png" alt=""></p>
  
  <p>Generated client class is as below.</p>
  
  <pre><code>public partial class Client
  {
      public Client()
      {
          this.PhoneNumbers = new HashSet&lt;PhoneNumber&gt;();
      }
  
      public int Id { get; set; }
      public string Name { get; set; }
  
      public virtual ICollection&lt;PhoneNumber&gt; PhoneNumbers { get; set; }
  }
  </code></pre>
  
  <p>And now I need to create a view page for "create client". This page should have space to enter PhoneNumbers also (ex: By default there should be two text boxes to enter phone numbers)</p>
  
  <pre><code>&lt;fieldset&gt;
      &lt;legend&gt;Client&lt;/legend&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.Name)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.Name)
          @Html.ValidationMessageFor(model =&gt; model.Name)
      &lt;/div&gt;
  
      &lt;p&gt;
          &lt;input type="submit" value="Create" /&gt;
      &lt;/p&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>as the above "create view" we can easily give an space for "model.Name", because it is a simple property. But how can i do something similar for collection of phone numbers..??</p>
  
  <p>I know that we can achieve this with ugly javascript code, but I would like to know the best easy and simple way, that we can use with ASP.NET MVC ... ?</p>