title: I am getting error while submitting the form for dropdown list in MVC 5 Value cannot be null. Parameter name: items
body: <p>I have a project in which I have a dropdown list which is bound to database. It is populating the values and my dropdown shows the values as well, but when I am submitting the form an error like below occurs:  </p>
  
  <blockquote>
    <p>Value cannot be null.<br>
    Parameter name: items<br>
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
    
    <p>Exception Details: System.ArgumentNullException: Value cannot be null.
    Parameter name: items</p>
  </blockquote>
  
  <p>I have bound the dropdown to the database but on post the controller is getting my class object which has a <code>gender</code> property. I check that my model object has the correct, selected value from the dropdown, but when it moves to the statement <code>modelstate.isvalid</code> it returns false. </p>
  
  <pre><code>public ActionResult Create(Registration registration)
  {
      if (ModelState.IsValid)
      {
          registration.ConfirmPassword = EncryptionLibrary.EncryptText(registration.ConfirmPassword);
          registration.Password= EncryptionLibrary.EncryptText(registration.Password);
          registration.Created_Date = DateTime.Now;
  
          if (ModelState.IsValid)
          {
              db.Registration.Add(registration);
              db.SaveChanges();
              ViewBag.teacher = "Teacher account has been created Successfully";
              return RedirectToAction("Create");
          }
  
          TempData["Faculty"] = "";
          var result = _IRegistration.AddFaculty(registration);
  
          if (result &gt; 0)
          {
              TempData["Success"] = "Faculty Added Successfully";
              ModelState.Clear();
              return RedirectToAction("Create");
          }
      }
      return View(registration);
  }
  </code></pre>
  
  <p>Below is my razor syntax for the dropdown to bind the values from viewbag:</p>
  
  <pre class="lang-cs prettyprint-override"><code>  @Html.DropDownListFor(model=&gt;model.Gender, new SelectList(ViewBag.Gender, "Id", "Name"), "Please select", new { @id = "ddlFruits",@class="btn form-text" })
  </code></pre>
  
  <p>I want to save the gender dropdown value into the database although it is getting populated then why it is saying Value cannot be null.<br>
  Parameter name: items</p>