Updating a DIV from Jquery

Apr 12 2011 7:12 AM
 
Hi I have a small partial view which is to be populated into a div. The div is not gettin updated with the returned partial view.

This is the controller :


public ActionResult GFISNumbersTable(int id)
{
Archive archive = _archiveService.GetArchive(id);
var viewModel = new ArchiveViewModel(archive, _archiveService, null, 0, ArchiveViewModel.DataLoadFlags.None);
return PartialView("GFISNumbersTable", viewModel);
}


this is the jquery code:

$("#ResultTable").load("/Archive/GFISNumbersTable/", { id: formvar });



and the partial view is as:

<%
  foreach (Engagement engagement in Model.Archive.Engagements.OrderBy(x => x.EngagementNumber))
            {
                if (engagement.EngagementNumber != Model.Archive.EngagementNumber)
                {%>
                        <tr>
                            <td>
                                <%=engagement.EngagementNumber.ToString()%>
                            </td>
                            <td style="padding-left: 50px">
                                <%=engagement.Name.ToString()%>
                            </td>
                        </tr>
              <%}
            } %>



The DIV to update is as:


<div id="ResultTable"><%Html.RenderPartial("GFISNumbersTable", Model); %></div>

which is in the same document as the jquery is written.


The partial view i think is returned successfully, with the desired results, but the DIV is not getting updated.

Please help...
Thanks in advance..

Answers (2)