title: Load partial view on same page on click
body: <p>My Edit Customer page have a partial view that shows all his/hers invoices:</p>
  
  <pre><code>@{Html.RenderAction("_ShowInvoices", "Adresser", new { id = Model.Adressid });}
  </code></pre>
  
  <p>That partial view have this link to open the Invoice Edit page in a new page:</p>
  
  <pre><code>Html.ActionLink(item.InvoiceNr, "Edit", "Invoice", new { id = item.InvoiceNr }, null)
  </code></pre>
  
  <p>But now I want to open the Invoice Edit page in another partial view on my Edit Custormer page. So I changed the link on the Invoice Edit page to</p>
  
  <pre><code>@Ajax.ActionLink(item.InvoiceNr.ToString(), "EditInvoice", "Invoice", new { id = item.InvoiceNr }, new AjaxOptions() { UpdateTargetId = "edit_invoices" })
  </code></pre>
  
  <p>Invoice Controller:</p>
  
  <pre><code>    public PartialViewResult EditInvoce(int id)
      {
          Invoices invoice = db.Prens.Find(id);
          return PartialView("_InvoiceEdit", invoice);
      }
  </code></pre>
  
  <p>And added this to my Edit Customer page</p>
  
  <pre><code>        &lt;div id="edit_invoices"&gt;
              @Html.Partial("_InvoiceEdit")
          &lt;/div&gt;
  </code></pre>
  
  <p>Which for now contains this so I can see if its workning..</p>
  
  <pre><code>@model Pren.Models.Invoices
  @Html.DisplayFor(model =&gt; model.InvoiceNr)
  </code></pre>
  
  <p>I've also added this to my Customer Edit page</p>
  
  <pre><code>&lt;script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The error I get is (Pren.Models.Adress is the customer model)</p>
  
  <blockquote>
    <p>The model item passed into the dictionary is of type 'Pren.Models.Adress', but this dictionary requires a model item of type 'Pren.Models.Invoices'.</p>
    
    <p>Line 138:                @Html.Partial("_InvoiceEdit")</p>
  </blockquote>
  
  <p>So where am I wrong? Is @Html.Partial() the wrong one to use? Should I do this another way? Give me your input please!</p>