title: Get Id and Type from Html.DropDownList to Controller
body: <p>I have a class called</p>
  
  <pre><code>public class Person
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public Country Country { get; set; }
  }
  
  public class Country
  {
      public int Id { get; set; }
      public string Type { get; set; }
  }
  </code></pre>
  
  <p>My MVC View Page is Strongly typed to Person and there is a dropdownlist which show the list of countries.</p>
  
  <p>In My Controller Index</p>
  
  <pre><code>public ActionResult Index()
  {
      LoadCountryList();
      return View(Person);
  }
  
  private void LoadCountryList()
  {
      IEnumerable&lt;CountryList&gt; countryList = CountryListService.GetCountryList();
      ViewData["CountryList"] = new SelectList(country, "Id", "Type", 0);
  }
  </code></pre>
  
  <p>Code in the html</p>
  
  <pre><code>&lt;%: Html.DropDownListFor(model =&gt; model.Country.Id, (IEnumerable&lt;SelectListItem&gt;)ViewData["CountryList"], "--Select--")%&gt;
  </code></pre>
  
  <p>When the page is submitted Create method is called in the controller</p>
  
  <pre><code>public ActionResult Create(Person person)
  {
      // person.Country.Id has the value
      // person.Country.Type is null
  }
  </code></pre>
  
  <p>I am getting only the Country Id from the object person in the Create Method. The Country Id is loaded inside the Person Object under Country.</p>
  
  <p>Is there any way I can get both the Id and Type of the country when passed from the Page to the Controller? </p>
  
  <p>I know I am passing Html.DropDownListFor(model => model.Country.Id .... from here.</p>
  
  <p>Is there any Solution so that I get Id and Type in the controller. </p>
  
  <p>Thanks</p>