<%= Ajax.ActionLink("Delete", "Delete", new { id = item.int_GroupId }, new AjaxOptions {HttpMethod="Delete开发者_StackOverflow", Confirm="Delete Group with Group ID:" + item.int_GroupId + " Group Name:" + item.vcr_GroupName})%>|
[HttpDelete]
public ActionResult Delete(int id, FormCollection collection)
{
try
{
Group group = _db.Groups.First(c => c.int_GroupId == id);
_db.Groups.DeleteOnSubmit(group);
_db.SubmitChanges();
return RedirectToAction("ManageGroup"); // redirect to same list page
}
catch
{
return RedirectToAction("ManageGroup"); // redirect to same list page
}
}
1) How would i display the updated records after the delete operation. Redirect operation is not happening due to unknown reason to me. What is the best way you people use here 2) HOW Would i display the acknowledgment The record is deleted on the same listing page after the new records are displayed?
I used partial view which solved my problem
精彩评论