title: There is no ViewData item of type 'IEnumerable' that has the key 'Conve'
body: <p>I am making a tweak to an app and doing an UPDATE. It throws me the following error:</p>
  <blockquote>
  <p>There is no ViewData item of type 'IEnumerable' that has the key 'Conve'.</p>
  </blockquote>
  <p>My <strong>DropDownList</strong> loads the data perfectly but when I select any of that list to use its value and change it to the value that is in my <strong>BD</strong> it throws that error</p>
  <p>Model: TableAsign.cs</p>
  <pre><code>public class TableAsign
  {
      public long IdCliente { get; set; }
      public string nombre { get; set; }
  }
  </code></pre>
  <p>Controller: MastController.cs</p>
  <pre><code>[Authorize]
  public ActionResult Asign_Conv(int idUsuario)
  {
      List&lt;Models.TableAsign&gt; lst = null;
      using (TPConveniosEntities db = new TPConveniosEntities())
      {
          lst = (from d in db.Cliente
                 orderby d.nombre
                 select new TableAsign
                 {
                     IdCliente = d.idCliente,
                     nombre = d.nombre
                 }).ToList();
      }
      List&lt;SelectListItem&gt; items = lst.ConvertAll(d =&gt;
      {   return new SelectListItem()
          {   Text = d.nombre.ToString(),
              Value = d.IdCliente.ToString(),
              Selected = false
          };
      });
  
      ViewBag.items = items;
  
      using (TPConveniosEntities db = new TPConveniosEntities())
      {
          Usuario user = db.Usuario.FirstOrDefault(u =&gt; u.idUsuario == idUsuario);
          return View(user);
      }
   }
  </code></pre>
  <p>In this part it performs the <strong>UPDATE</strong> and it seems to me that it has to do when I bring the value of my <strong>DropDownList</strong> with my <strong>long</strong> variable, it throws me the error and then when I consult my DB I see that if it performs the <strong>UPDATE</strong> but giving me that error</p>
  <pre><code>[Authorize]
  [HttpPost]
  public ActionResult Asign_Conv(FormCollection collection)
  {
      using (TPConveniosEntities contexto = new TPConveniosEntities())
      {
          var idUsuario = Convert.ToInt32(collection[&quot;IdUsuario&quot;].Trim());
          Usuario user = contexto.Usuario.FirstOrDefault(u =&gt; u.idUsuario == idUsuario);
  
          var userName = collection[&quot;usuario&quot;].Trim();
          long IdCliente = Convert.ToInt32(collection[&quot;Convenio&quot;].Trim());
  
          user.userName = userName;
          user.idCliente = IdCliente;
  
          contexto.SaveChanges();
          return View(user);
      }
  }
  </code></pre>
  <p>VIEW: Asign_Conv.cshtml</p>
  <pre><code>@using TPConvenios.App_Data;
  @model Usuario
  @{
      Layout = null;
      AjaxOptions ajaxOpciones = new AjaxOptions
      {
          UpdateTargetId = &quot;cuerpoPopUpGenerico2&quot;,
          InsertionMode = InsertionMode.Replace,
          OnSuccess = &quot;OnSuccess_Asign&quot;,
          OnFailure = &quot;OnFailure&quot;
      };
      List&lt;SelectListItem&gt; items = (List&lt;SelectListItem&gt;)ViewBag.items;
  }
  &lt;div id=&quot;contenedor&quot; style=&quot;margin: 15px 30px&quot;&gt;
      @using (Ajax.BeginForm(&quot;Asign_Conv&quot;, &quot;Mast&quot;, null, ajaxOpciones, new { id = &quot;Asign_Conv&quot; }))
      {  @Html.ValidationSummary(true);
       &lt;input type=&quot;hidden&quot; name=&quot;idUsuario&quot; id=&quot;idUsuario&quot; value=&quot;@(null != Model ? Model.idUsuario : 0)&quot; /&gt;
       &lt;p&gt;
         &lt;input name=&quot;usuario&quot; type=&quot;text&quot; id=&quot;usuario&quot; class=&quot;usuario&quot; placeholder=&quot;Usuario&quot; value=&quot;@(null != Model ? Model.userName : String.Empty)&quot;/&gt;
       &lt;/p&gt;
       &lt;p&gt;
         @Html.DropDownList(&quot;Convenio&quot;, items, &quot;Seleccione el Convenio&quot;, new { @class = &quot;form-control&quot; })
       &lt;/p&gt;
       &lt;p id=&quot;bot&quot;&gt;
       &lt;input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; value=&quot;Asignar&quot; class=&quot;botonNuevo&quot; style=&quot;float: right&quot; /&gt;
       &lt;/p&gt;
      }
  &lt;/div&gt;
  </code></pre>