title: MVC Razor - DropDownListFor - Error on Post
body: <p>i'm trying to associate the selected Value to a a parameter defined in Model but now i have the error: "Value cannot be null.
  Parameter name: items"</p>
  
  <p>In Model i have: </p>
  
  <pre><code>public class ObjectivesModel
  {
  
      [Required(ErrorMessage = "*")]
      [Display(Name = "AssociatedGoal")]
      public int AssociatedGoal { get; set; }
  </code></pre>
  
  <p>}</p>
  
  <p>In Controler i create the list</p>
  
  <pre><code>[HttpGet]
      public ActionResult NewObjective()
      {
          IEnumerable&lt;SelectListItem&gt; example = new List&lt;SelectListItem&gt;
          {
              new SelectListItem() { Text = "ola1", Value = "1" },
              new SelectListItem() { Text = "ola2", Value = "2" }
          };
  
          ViewBag.GoalsToAssociate = example;
  
          return View();
      }
  </code></pre>
  
  <p>And Finally in View I have</p>
  
  <pre><code>@using (Html.BeginForm()){
  
               &lt;div class="editor-label"&gt;@Html.LabelFor(o =&gt; o.AssociatedGoal)&lt;/div&gt;
              &lt;div class="editor-DropDownList"&gt;@Html.DropDownListFor(o =&gt; o.AssociatedGoal, new SelectList(@ViewBag.GoalsToAssociate, "Value", "Text"), "--Select Goal--")
              @Html.ValidationMessageFor(o =&gt; o.AssociatedGoal)
  
              &lt;/div&gt;
  </code></pre>
  
  <p>So the error occurs when i submit the form..
  I have any special code yet on post version of controler</p>
  
  <pre><code>[HttpPost]
      public ActionResult NewObjective(Models.ObjectivesModel objective)
      {
  
          return View();
      }
  </code></pre>