MVC4 (+Razor) でフォームを実装しようとしていますが、送信ボタンは何もしていません。
コントローラー (post アクションを取得する必要があります):
public class GeneralController
{
[HttpPost]
public ActionResult SearchResults(SearchParamsModel searchParams)
{
// doin some stuff here
return View("SearchResultsView");
}
}
ビュー (.cshtml)
@model Models.SearchParamsModel
@using (Html.BeginForm("SearchResults", "General", FormMethod.Post))
{
<section class="form-field">
<input type="text" name="Property1" id="Property1" class="field field139 autocomplete-init-no-img" />
<label for="Property1">value1</label>
<form action="" method="post" class="clearfix">
<input type="submit" value="some value" class="submit btn blue-btn special-submit" />
</form>
</section>
}
モデル
public class SearchParamsModel
{
public string Property1{ get; set; }
}