[asp.net] 데이터 삭제후에 MVC에서 페이지 reload 하기

Posted by RAY.D
2015. 4. 27. 15:01 Web/ASP.NET MVC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.





MVC reload page after Delete


My delete method is working but you have to manually refresh the browser to see that it has been deleted. I simply want to reload the page but I can't get it to work. Can someone tell me the proper way to do this?

public virtual ActionResult Index()
{
    var recipientOrchestrator = new RecipientsOrchestrator();
    RecipientsViewModel model = recipientOrchestrator.GetRecipientsPageData();
    return View(model);
}


[HttpPost]
public virtual ActionResult Delete(int id, int applicationId) 
{
    var recipientOrchestrator = new RecipientsOrchestrator();
    recipientOrchestrator.DeleteRecipient(id, applicationId);

    return Index();

}





return RedirectToAction("Index");




한마디로 컨트롤러에서 RedirectToAction ~