html代码如下:@using(Html.BeginForm("Show", "Search", new {kw=},
FormMethod.Post, new { @class = "searchform" })) {
<input type="text" id="searchBox" placeholder="搜索..." class="search_txt" />
<input type="button" class="search_btn" value=""/>
}其中,new{kw=}是想获取input text中的值action原型如下:public ActionResult Show(string kw, string orderType = "0")
该怎么做呢C#ASP.NET MVCMVC
FormMethod.Post, new { @class = "searchform" })) {
<input type="text" id="searchBox" placeholder="搜索..." class="search_txt" />
<input type="button" class="search_btn" value=""/>
}其中,new{kw=}是想获取input text中的值action原型如下:public ActionResult Show(string kw, string orderType = "0")
该怎么做呢C#ASP.NET MVCMVC
1、javascript
2、MVC action如果是第二种情况, 要写个新的ACTION 要加上 HttpPost 属性 [HttpPost]
public ActionResult Show(string kw, string orderType = "0")
{
}