This is a migrated thread and some comments may be shown as answers.

[Solved] Ajax binding not firing when loading an Action from Ajax.ActionLink

0 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Justin Bigelow
Top achievements
Rank 1
Justin Bigelow asked on 14 Dec 2011, 07:38 PM
I have an Action that contains a single Telerik Grid that utilizes Ajax binding. When I render the Action directly to my view the Grid binds correctly.

<div id="ListGrid">
    <% Html.RenderAction("ListAppointments", "Appointments", new { id = Model }); %>
</div>

When I look at what happens in Fiddler I see the name of the Ajax binding action being called:
/Appointments/_AjaxListAppointments/16968

However, I need to be able to able to alter the contents of the ListGrid div so I removed the RenderAction call from within the div and moved it into an Ajax.ActionLink that targets the div:
<%: Ajax.ActionLink("List Appointments by DSA", "ListAppointments", "Appointments", new { id = Model }, new AjaxOptions {
        UpdateTargetId = "ListGrid", HttpMethod="POST" }) %>
<div id="ListGrid">
</div>
The problem is when I click on the action link the target div is updated with an empty grid that reads "No Records to display". I looked in Fiddler again and now I am seeing the parent action being called but not the ajax binding action being called:
/Appointments/ListAppointments/16968

I tried to tweak my Ajax.ActionLink call to call the _AjaxListAppointments action but that just returned the raw JSON to the view instead of the grid with data.

Any input on how I can correct this? Thanks.
Tags
Grid
Asked by
Justin Bigelow
Top achievements
Rank 1
Share this question
or