这是我的控制器,它执行数据库查询并将结果返回到调用此控制器的表单:
[HttpPost]
public ActionResult Index(string File)
{
var list = db.Objects.Where(x => x.protocol == File).ToArray();
ViewBag.Files = list;
//return View();
}
现在,我不想以相同的形式返回结果,而是要打开新表单,所以我将其更改为:
[HttpPost]
public ActionResult Index(string File)
{
var list = db.Objects.Where(x => x.protocol == File).ToArray();
ViewBag.Files = list;
return RedirectToAction("ShowList", ???);
}
并创建新方法:
public ActionResult ShowList(string site)
{
var list = db.Objects.Where(x => x.protocol == site).ToArray();
ViewBag.Files = list;
return View();
}
目前我不知道如何将收到的字符串发送到新方法(ShowList)