title: MVC Complex Object Binding
body: <p>I'm using MVC, Have the following Model</p>
  
  <pre><code>public class Questionnaire 
       {
       public string Name { get; set; }
       public List&lt;Question&gt; Questions { get; set; }
   }
  </code></pre>
  
  <p>and Question class is :</p>
  
  <pre><code>public class Question 
   {
       public int QuestionNumber { get; set; }
       public string Body { get; set; }
       public IList&lt;Option&gt; Options { get; set; }
       //public IEnumerable&lt;CreativeFactory.Option&gt; OptionsTemp { get; set; }
       public Guid? QuestionnaireId { get; set; }
       public Guid? SelectedOption { get; set; }
       public int? SelectedEmployeeId { get; set; }
  
    } 
  </code></pre>
  
  <p>In my View I do foreach, and partially render a view</p>
  
  <pre><code>    % Html.BeginForm("Submit", "Questionnaire", FormMethod.Post); %&gt;
      &lt;%
  
      foreach (var q in Model.Questions)
      {
      Html.RenderPartial("Question", q);
      }
      %&gt;
      &lt;input type="submit" name="submit" value="submit" /&gt;
      &lt;% Html.EndForm(); %&gt;
  </code></pre>
  
  <p>My problem is the passed model to my action is always null</p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
           public ActionResult Submit(Questionnaire m)
           {
  }
  </code></pre>
  
  <p>EDIT 1:
  Well, My Partial View Code is :    </p>
  
  <pre><code>&lt;%
   foreach (var option in Model.Options)
   {%&gt;
     &lt;p/&gt;
   &lt;%= Html.RadioButtonFor(x =&gt; x.SelectedOptionId, option.QuestionId, new { id = "test" +    option.ID })%&gt;
  &lt;%
  }     
  %&gt;
  </code></pre>
  
  <p>Even in the debugging Mode, I can't find my collection in the Form instance
  so even Custom Binding dosn't solve the problem, because the collection is not exist</p>
  
  <p>any idea please?</p>