【发布时间】:2013-11-21 17:21:21
【问题描述】:
嗨,我有一个包含搜索表单的部分视图,搜索表单重定向到控制器“搜索”中的操作“搜索”。 我在多个位置使用此表单,但我需要控制器“搜索”中的操作“搜索”来获取此表单用于执行某些操作的位置
_SearchForm(查看)
@using (Html.BeginForm("Search", "Search", FormMethod.Post))
{
@Html.TextBox("querySTR")
<input class="btn btn-primary btn-large" type="submit" value="Search" />
<label>@Html.RadioButton("rdList", "rdExact") Exact Term</label>
<label>@Html.RadioButton("rdList", "rdStart", true) Start of Term</label>
<label>@Html.RadioButton("rdList", "rdPart") Part of Term</label>
}
控制器
public ActionResult Search(FormCollection 集合)
{
return RedirectToAction("Index", "我现在所在的另一个控制器");
}
【问题讨论】:
-
看看这是否有帮助...stackoverflow.com/questions/18299669/…
-
如果你要去另一个区域或控制器..试试这个...stackoverflow.com/questions/10785245/…
标签: c# asp.net-mvc