Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC Partial View Model Not Refreshing
    primarykey
    data
    text
    <p>I have a partial view which is being loaded into an jQuery modal in asp.net MVC 3. The problem is that the view is not refreshing properly. Here is the order of events:</p> <p>1) The main view has a table listing different events records. There is a link on each row of the table to show the event detail. 2) When the link on this table is clicked, the partial view is loaded in the modal.</p> <p>This works fine in some cases, in other cases the model will take very long to load. After closing the partial view/modal and clicking on another link from the table on the main view, the partial view will load showing the data from the previous load. It is not refreshing correctly.</p> <p><strong>Definition of Modal on Main View:</strong> Loading, please wait... </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $("#EventRegistrantSummary").dialog({ bgiframe: true, autoOpen: false, height: 500, width: 980, resizable: false, modal: true }); }); function showEventRegistrantSummary(id) { $.get("/Event/EventRegistrantSummary/" + id, function (data) { $("#EventRegistrantSummary").html(data); }); $("#EventRegistrantSummary").dialog('open'); return false; } &lt;/script&gt; </code></pre> <p><strong>Controller:</strong></p> <pre><code> public PartialViewResult EventRegistrantSummary(Guid id) { ModelState.Clear(); Event e = db.Events.Single(ev =&gt; ev.ID == id); return PartialView(e); } </code></pre> <p><strong>Partial View:</strong></p> <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;model.Event&gt;" %&gt; &lt;% using (Ajax.BeginForm("EditUpdate", new AjaxOptions { UpdateTargetId="Target", InsertionMode= InsertionMode.Replace})) {%&gt; &lt;h6 style="text-align:center"&gt;Registration Summary: &lt;%= Model.Name %&gt;&lt;/h6&gt; &lt;div style="float:left;width:35%"&gt; &lt;fieldset id="Overview"&gt; &lt;legend&gt;Overview&lt;/legend&gt; &lt;div class="editor-label"&gt; Total Registrants: &lt;%= Model.BoatEventRegistrations.Count() %&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;% } %&gt; </code></pre> <p>Any help is much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload