C# 如何在mvc3 asp.net中发送文本框值作为表单提交的参数

C# 如何在mvc3 asp.net中发送文本框值作为表单提交的参数,c#,asp.net-mvc-3,razor,C#,Asp.net Mvc 3,Razor,我已经在MVC3中创建了局部视图。现在我想在按下提交按钮时发送文本框值作为表单提交的参数 我的部分观点是 @using (Html.BeginForm("Searching", "AccountManager", FormMethod.Post, new { name ="Wat should i put here" })) { <input id="account" type="text" class="s" /> <input id="Search" typ

我已经在MVC3中创建了局部视图。现在我想在按下提交按钮时发送文本框值作为表单提交的参数

我的部分观点是

@using (Html.BeginForm("Searching", "AccountManager", FormMethod.Post, new { name ="Wat should i put here" }))
 {

   <input id="account" type="text" class="s" />
   <input id="Search" type="submit" class="b" value="hi" />

 }

只需将文本框命名为与动作参数参数相同的名称:

@using (Html.BeginForm("Searching", "AccountManager")
{
    <input id="account" type="text" name="name" class="s" />
    <input id="Search" type="submit" class="b" value="hi" />
}
@using (Html.BeginForm("Searching", "AccountManager")
{
    <input id="account" type="text" name="name" class="s" />
    <input id="Search" type="submit" class="b" value="hi" />
}
public ActionResult Searching(string name)
{
    // bussiness logic
    return View();
}