title: Populate Data in DropDownList in Create Mode MVC 4
body: <p>I'm trying to populate data from table in DropDownList using MVC4. Trying to figure it out how to get all the languages' titles into the DropDown in the Edit mode.</p>
  
  <p>Models:</p>
  
  <pre><code>public class CategoryLanguage
      {
          public int ID { get; set; }
          public int LanguageID { get; set; }
          public string Title { get; set; }
          public string Description { get; set; }
      }
  
  public class Language
      {
          public int ID { get; set; }
          public string Title { get; set; }
      }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public ActionResult Create()
          {
              using (MyDBContext db = new MyDBContext())
              {
                  ViewBag.ID = new SelectList(db.Languages, "ID", "Title");
                  return View();
              }
          }
  
          //
          // POST: /Emp/Create
  
          [HttpPost]
          public ActionResult Create(CategoryLanguage newCatLang)
          {
              using (MyDBContext db = new MyDBContext())
              {
                  if (ModelState.IsValid)
                  {
                      db.CategoryLanguages.Add(newCatLang);
                      db.SaveChanges();
                      return RedirectToAction("Index");
                  }
  
                  ViewBag.ID = new SelectList(db.Languages, "ID", "Title", newCatLang.LanguageID);
                  return View(newCatLang);
              }
          }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@model MultilanguageCategories.CORE.Models.CategoryLanguage
  
  @{
      ViewBag.Title = "Create";
  }
  
  &lt;h2&gt;Add New Item&lt;/h2&gt;
  
  @using (Html.BeginForm())
  {
          @Html.ValidationSummary(true)
  
          @Html.DropDownList("ID", "--Select--")
  }
  </code></pre>
  
  <p>Trying to figure it out how to get all the languages' titles into the DropDown when creating new CategoryLanguage entity. The error says: "The operation cannot be completed because the DbContext has been disposed." and this line marked: @Html.DropDownList("ID", "--Select--")</p>