title: how to create a view with multiple models mvc 4?
body: <p>so i works in asp.net mvc 4 project and i have a problem in my view, what i want is create a view with 2 differnt type of model,first view (Index) take IEnumerable (Models.myModel) the second (subscriber Details) take Models.myModel, <strong>this is my Model code :</strong>      </p>
  
  <pre><code>public class SubscribersModel
  {
  
      [Required]
      [DataType(DataType.Text)]
      public string name { get; set; }
  
      [Required]
      [DataType(DataType.Text)]
      [StringLength(maximumLength: 10, MinimumLength = 7)]
      public string cin { get; set; }
  
      [Required]
      [DataType(DataType.Date)]
      public DateTime birthday { get; set; }
  
      [DataType(DataType.Text)]
      public string birthplace { get; set; }
    }
  </code></pre>
  
  <p><strong>My controller code :</strong></p>
  
  <pre><code> public class SubscribersController : Controller
  {
      private AgencyDbEntities dbcontext = new AgencyDbEntities();
      private Subscribe sb = new Subscribe();
  
      public ActionResult Index()
      {
          var subscribers = from sb in dbcontext.Subscribes select new SubscribersModel {      cin = sb.cin, name = sb.name, birthday = (DateTime)sb.birthDay, birthplace = sb.birthPlace   };
  
          return View(subscribers);
      }
  
      public ActionResult Details(string id,string cin,string name)
      {
          var subscriber = new SubscribersModel();
          IEnumerable&lt;Subscribe&gt; list = from s in dbcontext.Subscribes select s;
          foreach (var sb in list)
          {
              if (sb.cin == id)
              {
                  subscriber.cin = sb.cin;
                  subscriber.name = sb.name;
                  subscriber.birthday = (DateTime)sb.birthDay;
                  subscriber.birthplace = sb.birthPlace;
              }
          }
          return View(subscriber);
      }
   }
  </code></pre>
  
  <p><strong>My index view :</strong></p>
  
  <pre><code>  @model IEnumerable&lt;_3SDWebProject.Models.SubscribersModel&gt;
  
  @{
      ViewBag.Title = "Subscribers";
  }
      &lt;div class="sidebar"&gt;
        //here i want to show my details view
       &lt;/div&gt;
   &lt;div class="content" style="width: 700px; margin-left: 250px; height: 545px;margin-  top: -30px;"&gt;
    &lt;h2&gt;Subscribers&lt;/h2&gt;
  &lt;p&gt;
       @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  
   @Styles.Render("~/Content/css")
   &lt;script src="@Url.Content("~/Scripts/Table.js")" type="text/javascript"&gt;&lt;/script&gt;
   &lt;table class="altrowstable" id="alternatecolor"&gt;
   &lt;tr&gt;
      &lt;th&gt;
          CIN
      &lt;/th&gt;
      &lt;th&gt;
          Name
      &lt;/th&gt;
      &lt;th&gt;
          birthday
      &lt;/th&gt;
      &lt;th&gt;
          birthplace
      &lt;/th&gt;
       &lt;th class="operations"&gt;
          Operations
      &lt;/th&gt;
  &lt;/tr&gt;
  
   @foreach (var item in Model)
  {
  &lt;tr&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.cin)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.name)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.birthday)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.birthplace)
      &lt;/td&gt;
      &lt;td&gt;
        @Html.ActionLink("Details", "Details", new { id = item.cin }, new { @class = "details-logo"})
       &lt;/td&gt;
  &lt;/tr&gt;
  }
  
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>my Details view :</strong></p>
  
  <pre><code>@model _3SDWebProject.Models.SubscribersModel
  
  &lt;fieldset&gt;
  &lt;legend&gt;SubscribersModel&lt;/legend&gt;
  
  &lt;div class="display-label"&gt;
       @Html.DisplayNameFor(model =&gt; model.name)
  &lt;/div&gt;
  &lt;div class="display-field"&gt;
      @Html.DisplayFor(model =&gt; model.name)
  &lt;/div&gt;
  &lt;div class="display-label"&gt;
       @Html.DisplayNameFor(model =&gt; model.birthday)
  &lt;/div&gt;
  &lt;div class="display-field"&gt;
      @Html.DisplayFor(model =&gt; model.birthday)
  &lt;/div&gt;
  
  &lt;div class="display-label"&gt;
       @Html.DisplayNameFor(model =&gt; model.birthplace)
  &lt;/div&gt;
  &lt;div class="display-field"&gt;
      @Html.DisplayFor(model =&gt; model.birthplace)
  &lt;/div&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>so please if someone have any idea or solution i will be very appreciate:
  NB:this a picture describe what i want
  <img src="https://i.stack.imgur.com/sR09b.png" alt="enter image description here"></p>