Problems with MVC Ajax.ActionLink and returning a PartialView

Posted by mwright on Stack Overflow See other posts from Stack Overflow or by mwright
Published on 2010-04-05T17:38:23Z Indexed on 2010/04/05 17:43 UTC
Read the original article Hit count: 465

I'm trying to implement a simple Ajax update using MVC and have run into an issue.

My understanding of how to implement Ajax with MVC is to use an Ajax.ActionLink which allows the content to be updated based on user interaction. I have an Ajax.ActionLink that looks like the following:

<%= Ajax.ActionLink("Call Ajax", "Ajax", new AjaxOptions{UpdateTargetId = "updateDiv"}) %>

If, in the controller, I return a string it works fine. However, when returning a PartialView instead, nothing happens.

I can step through and verify that the controller is "returning" the partial view but nothing shows up in what I'm calling the updateDiv.

How can I go about determining what the problem is?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about actionlink