title: use different model in the partial view
body: <p>I have a view <code>view1.cshtml</code> that uses a <code>ClassA</code> as a model, and in the <code>view1</code> there is a partial view .. I want the partial view to use <code>ClassB</code> as a model.</p>
  
  <p>is that possible ?</p>
  
  <p><strong>EDIT</strong> add <code>classB</code></p>
  
  <pre><code>public class Device
      {
  
          public int DeviceId { get; set; }
  
          public string SerialNo { get; set; }
  
          public string IMME { get; set; }
  
          public string RefNo { get; set; }
  
          public string Supplier { get; set; }
  
          public string Brand { get; set; }
  
          public string ModelNo { get; set; }
  
          public DateTime PurchaseDate { get; set; }
  
          public DateTime RegisterDate { get; set; }
  
          public string Notes { get; set; }
  
          public virtual ICollection&lt;ContractsDevice&gt; ContractsDevices { get; set; }
      }
  </code></pre>
  
  <p>and here the Action method:</p>
  
  <pre><code>[HttpGet]
          public ActionResult AssignDevice()
          {
              //list of devices
              List&lt;Device&gt; dev = new List&lt;Device&gt;();
              dev.Add(new Device { Brand = "Samsung" });
              dev.Add(new Device { Brand = "SONY" });
  
              return PartialView();
          }
  </code></pre>
  
  <p>and here the partial view :</p>
  
  <pre><code>&lt;div class="modal-header"&gt;
      &lt;h4 class="modal-title"&gt;Assign Device&lt;/h4&gt;
  &lt;/div&gt;
  &lt;div class="modal-body"&gt;
      Devices list here
  &lt;/div&gt;
  &lt;div class="modal-footer"&gt;
      &lt;button type="button" class="btn btn-primary"&gt;Save&lt;/button&gt;
      &lt;button type="button" class="btn btn-primary" data-dismiss="modal"&gt;Close&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>