title: Dropdown in dynamic views mvc4
body: <p>We are using dynamic views to display and edit the records.</p>
  
  <p>Say I have a model A:</p>
  
  <pre><code>public class A
  {
      public int AID { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public int organizationid { get; set; }
  }
  </code></pre>
  
  <p>And class B:</p>
  
  <pre><code>public class B
  {
      public int organizationid { get; set; }
      public string orgnmae { get; set; }
      public string orgdesc { get; set; }
  }
  </code></pre>
  
  <p>here organizationid  of table B is foreign key in table A.</p>
  
  <p>Now I have dynamic editor view, </p>
  
  <pre><code>@model dynamic
  @using (Html.BeginForm("Edit", null,  FormMethod.Post))
   {
     @Html.EditorForModel()
  
   &lt;input type="submit" value="Edit" /&gt;
  }
  </code></pre>
  
  <p>If we choose to edit any A's record, it will display this editor view with all text boxes. But for organizationid  I should not show integer value in it. 
  Instead I should show a dropdown with available organizations of table B and user can choose one of them to edit.</p>
  
  <p>How can I handle this? I read Darin's <a href="https://stackoverflow.com/questions/11498215/asp-net-mvc-built-in-support-for-dropdownlist-editor-template">answers here</a>; that's a good suggestion, but in my case the dropdown items should be part of another model.</p>