views:

353

answers:

1

has someone make ajax.actionlink for delete to work properly.After deleting the record successfully at the end it is not refreshing the page properly. the page refresh is my problem. i have defined the updatetarget id and returning view(model) from my controller but it is returning the master page with it.

So the thing is that i am having a page with a page.I have used redirect as well which is not refreshing,

 <%= Ajax.ActionLink("Delete", "Delete", new { id = item.int_OrganizationGroupId }, new AjaxOptions { UpdateTargetId = "abc", HttpMethod = "Post", Confirm = "Delete Group with Organization Group ID:" + item.int_OrganizationGroupId + "  Organization Group Name:" + item.vcr_OrganizationGroupName, OnSuccess = "handleSuccess" })%>|

abc is the id of the table

From controller

View("ManageGroup,Model);

+1  A: 

To use AJAX returns on models and views, you need to create a partial view and return that instead of a full view which will include your master page, etc.

Public Function AjaxView() as ActionResult
    Return PartialView("NameOfYourPartialView", ItemsToReturn)
End Function
Tommy