Question

I am new with MVC. But instead of using jQuery I want to use Ajax.ActionLink to call an Action that returns a View.
But when I am using ActionLink like below it inserts the whole body content into the UpdateTargetId:

        @Ajax.ActionLink("Projects", "Index", "Project", new AjaxOptions
       {
           LoadingElementId = "ajax-loader",
           UpdateTargetId = "content",
           InsertionMode = InsertionMode.Replace
       })

I want only specific element to be inserted into the target id e.g.table. I can easily do that using jQuery.load and selector table. But is there anyway to do the same thing using ActionLink?

Was it helpful?

Solution

@Adween was right. I had to return a Partial View.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top