【发布时间】:2014-06-25 23:55:32
【问题描述】:
Noob 需要帮助!)如何从同一控制器中的新操作返回现有视图? 例如我有以下代码:
[HttpGet]
public ActionResult Index()
{
return View(); //returns Index.cshtml
}
[HttpPost]
public ActionResult Index(string id, string condition)
{
SomeModel.ID = id;
SomeModel.Condition = condition;
return View(SomeModel); //returns Index.cshtml delegating the model
}
public ActionResult someAction()
{
return View(); //How to make this action return Index.cshtml??
}
【问题讨论】:
-
return View("Index"); -
我尝试这样做,但遇到错误
-
@user3493623 什么样的错误?
-
已从客户端收到潜在危险的 Request.Path 值(翻译自俄语)
-
@user3493623 恐怕你的问题是别的。您可能没有向我们展示更多代码,并且与错误有关。
标签: c# asp.net .net asp.net-mvc-4