title: UpdateModel not updating the model via ViewModel and property from DropDownListFor
body: <p>I am trying to set up an Edit view on which I have a text box and DropDownListFor. I have figured out a way to populate the DDLF, and the rendered and posted values are correct, but i cant seem to get the model to update properly.</p>
  
  <p>The object i am trying to update is generated from LINQtoSQL, and in database it has foreign key column. In LINQtoSQL class that resulted in "Contains" relationship. I can get to ID property that represents the column in DB, and also the object that it represents.</p>
  
  <pre><code>        zupanija = new Zupanija();       //object that needs to be updated
          zupanija.Drzava;                 //object that i want to change to make the update
          zupanija.DrzavaID;               //Property linked to object that should change
  </code></pre>
  
  <p>Only way i have figured out to do the update is to get the value from DDLF and use it to get the object that i want to change like this:</p>
  
  <pre><code>        [HttpPost]
          public ActionResult Edit(int id, FormCollection collection)
          {
           var zupanija = repo.ZupanijaById(id);
           var drzava = new repoDrzava().DrzavaById(Convert.ToInt32(collection["Zupanija.DrzavaID"]));
           zupanija.Drzava = drzava;
          }
  </code></pre>
  
  <p>Also when i try to update the ID field like this, then i get the folowing error:</p>
  
  <pre><code>           zupanija.DrzavaID = Convert.ToInt32(collection["Zupanija.DrzavaID"]);
  </code></pre>
  
  <p>Error: <em>throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();</em></p>
  
  <p>This seems to me that it is very lousy way to do this, and i am trying to get UpdateModel to work.</p>