Don't Refresh page on Delete MVC 5 Entity Framework6 RRS feed

  • Question

  • I am using foreach loop to Delete items on a page. Delete is working but is refreshing the page so user's can't see that the item is deleted. I don't want that. Below is my code. 

    public async Task<ActionResult> Delete(int contId)
                    var doc = _docResp
    			        .Include(x => x.ConSub.Headers)
    			        .Include(x => x.TestSub)
                        .Include(x => x.Statuses)
                        .Include(x => x.Feeds)
                        .Where(x => x.DocumentId == contId).ToList();
                    foreach (var u in doc)
                    await _uow.SaveChangesAsync();
    			    return RedirectToAction("Index", "Cars");


    Wednesday, February 22, 2017 7:18 PM


  • They'll help you over here in Microsoft official MVC forum





    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Proposed as answer by Just Karl Thursday, February 23, 2017 4:18 PM
    • Marked as answer by Dave PatrickMVP Friday, March 3, 2017 2:31 AM
    Wednesday, February 22, 2017 7:22 PM