【发布时间】:2016-12-29 01:48:46
【问题描述】:
我有两个动作;第一个
public ActionResult ViewRequests()
{
List<AgentRequests> Reqs = con.AgentRequests
.Where(x => x.Status == RequestStatus.Open)
.OrderBy(x => x.RequestedOn).ToList();
return View(Reqs);
}
第二个:
public ActionResult ProcessRequest(long Id)
{
// Code to export data to excel file
//return RedirectToAction("ViewRequests");
return View(KnoqedUsers);
}
我的第一个操作返回一个包含列表的视图。此列表的每一行都有一个链接 - “处理请求”,单击该链接会调用第二个操作。
我的第二个操作将生成一个 excel 文件输出以供下载。
我的问题是 - 当前正在处理单击的行。所以我需要将它从我的视图中删除。
如果我手动重新加载页面就可以了。但是如何自动重新加载呢?
我不能使用 2 个返回语句,如我的第二个代码所示。我怎样才能做到这一点?
【问题讨论】:
标签: asp.net-mvc redirecttoaction asp.net-mvc-views