title: There is no ViewData item of type 'IEnumerable' that has the key 'x'.'
body: <p>In my view i have a problem and my dropdownlist fails and doesn't work don't know why </p>
  
  <pre><code>@model DigikalaHR.View_Model.Entitys.Member
   .
   .
   .
   .
  &lt;div class="form-group"&gt;
          @Html.LabelFor(model =&gt; model.TeamId, "TeamId", htmlAttributes: new { @class = "control-label col-md-2" })
          &lt;div class="col-md-10"&gt;                
              @Html.DropDownList("TeamId",null,htmlAttributes: new {@clas="form-control" })
              @Html.ValidationMessageFor(model =&gt; model.TeamId, "", new { @class = "text-danger" })
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>in this code this is the error that i get</p>
  
  <blockquote>
    <p>There is no ViewData item of type 'IEnumerable' that has the key 'TeamId'.'</p>
  </blockquote>
  
  <p>if i change the code to this one</p>
  
  <pre><code>@Html.DropDownList("TeamId",model=&gt;model.TeamId,htmlAttributes: new {@clas="form-control" })
  </code></pre>
  
  <p>this is the error that i receive </p>
  
  <blockquote>
    <p>Cannot convert lambda expression to type 'IEnumerable' because it is not a delegate type</p>
  </blockquote>
  
  <p>also this is my Create method in my controller </p>
  
  <pre><code>  #region [- Create() -]
  
      #region [- Get -]
      public ActionResult Create()
      {
          return View();
      }
      #endregion
  
      #region [- Post -]
      // POST: Member/Create
      [ValidateAntiForgeryToken]
      [HttpPost]
      public ActionResult Create(string _fName, string _lName, string _describtion, string _pic, int _teamId, int _positionId)
      {
          try
          {
              // TODO: Add insert logic here
              Ref_Member = new View_Model.Buisiness.Member();
              //Ref_Member.CreateMember();
              return RedirectToAction("Index");
          }
          catch
          {
              return View();
          }
      }
  </code></pre>
  
  <p>and this is my View model that i passed into my view</p>
  
  <pre><code>  #region [- Id -]
      [ScaffoldColumn(true)]
      [DisplayName("شماره")]
      public int Id { get; set; } 
      #endregion
  
      #region [- FName -]
      [DisplayName("نام")]
      [Required(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "Required")]
      [StringLength(100, ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName  = "StringLength")]
      public string FirstName { get; set; }
      #endregion
  
      #region [- LName -]
      [DisplayName("نام خانوادگی ")]
      [Required(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "Required")]
      [StringLength(100, ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "StringLength")]
      public string LastName { get; set; }
      #endregion
  
      #region [- Describtion -]
      [DataType(DataType.MultilineText)]
      [DisplayName("توضیحات")]
      public string Description { get; set; }
      #endregion
  
      #region [- Pic -]
      [DisplayName("عکس")]
      [Required(AllowEmptyStrings =false,ErrorMessageResourceType =typeof(Resources.Messages), ErrorMessageResourceName = "Required")]
      public string Pic { get; set; }
      #endregion
  
      #region [- TeamId -]
      [DisplayName("شماره تیم")]
      public Nullable&lt;int&gt; TeamId { get; set; }
      #endregion
  
      #region [- PositionId -]
      [DisplayName("شماره سرپرست")]
      public int PositionId { get; set; }
  
      #endregion
  
      #region [- Departments -]
      [DisplayName("دپارتمان")]
      public ICollection&lt;Department&gt; Departments { get; set; } 
      #endregion
  
      public  Position Position { get; set; }
      public  Team Team { get; set; }
  
      public  ICollection&lt;Team&gt; Teams { get; set; }
  }
  </code></pre>