title: MVC2: How submit data from Partial view to his controller?
body: <p>I have this model:</p>
  
  <pre><code>public class Package
  {
      public string CustomerName { get; set; }
      public List&lt;Product&gt; Products { get; set; }
      public int Id { get; set; }
  }
  
  public class Product
  {
      public int Quantity { get; set; }
      public string Name { get; set; }
      public int Id { get; set; }
  }
  </code></pre>
  
  <p>I have a <strong>Create</strong>'s view for creating a new Package and one or many <strong>Create product</strong>'s <strong>PartialView</strong>.</p>
  
  <p>How I can submit the Product informations to the Product's controller without leave the View?</p>
  
  <p>Here is my Product's Partialview code:</p>
  
  <pre><code>&lt;% using (Ajax.BeginForm("Create", "Product", new AjaxOptions())) {%&gt;
      &lt;%: Html.ValidationSummary(true) %&gt;
  
      &lt;fieldset&gt;
          &lt;legend&gt;Fields&lt;/legend&gt;
  
          &lt;div class="editor-label"&gt;
              &lt;%: Html.LabelFor(model =&gt; model.Name) %&gt;
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              &lt;%: Html.TextBoxFor(model =&gt; model.Name) %&gt;
              &lt;%: Html.ValidationMessageFor(model =&gt; model.Name) %&gt;
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              &lt;%: Html.LabelFor(model =&gt; model.Quantity) %&gt;
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              &lt;%: Html.TextBoxFor(model =&gt; model.Quantity) %&gt;
              &lt;%: Html.ValidationMessageFor(model =&gt; model.Quantity) %&gt;
          &lt;/div&gt;
  
  &lt;%--    &lt;p&gt;
              &lt;input type="submit" value="Create" /&gt;
          &lt;/p&gt;--%&gt;
      &lt;/fieldset&gt;
  
  &lt;% } %&gt;
  </code></pre>
  
  <p>Thank you</p>