如何为搜索和结果创建 ActionResults,无法弄清楚

How to create ActionResults for Search and Result, cannot figure out

我正在尝试创建搜索和结果页面。第一个 UserTotalTimeSpentReport() 函数 returns ActionResult 是一个搜索页面。然后,用户进行一些选择和 post 页面。然后,它将转到第二个 UserTotalTimeSpentReport(),其中有 [HttpPost] 标记。在第二个 UserTotalTimeSpentReport 中,我执行了一个复杂的 LINQ 查询并生成了一个结果。我不知道如何显示该结果,因为它采用相同的 ActionResult。我需要将用户转发到另一个页面。这样做的正确方法是什么?

public ActionResult UserTotalTimeSpentReport()
{
    UserTotalTimeSpentModel model = new UserTotalTimeSpentModel();
    return View(model);
}

[HttpPost]
public ActionResult UserTotalTimeSpentReport(string AntsoftCrmUser, DateTime? StartDate, DateTime? EndDate) 
{
 .....
 .....
 return View(result)
}

如果您的意思是另一种观点,那么这就是要走的路:

[HttpPost]
public ActionResult UserTotalTimeSpentReport(string AntsoftCrmUser, DateTime? StartDate, DateTime? EndDate) 
{
 .....
 .....
 return View("the name of your view here", result)
}

您可以阅读有关视图方法不同重载的更多信息here