私のかみそりビューには、ユーザーからの日付を受け入れる単純なフォームがあります。
@using (Html.BeginForm("CancelByDate", "ClassExample", FormMethod.Post, new { id = "dateForm" }))
{
<input id="dateInput" type="date" width="10" class="date" />
<input type="submit" value="Continue" />
}
CancelByDate アクションでこのデータを取得するにはどうすればよいですか?
私はいくつかの方法を試しました:
public ActionResult CancelByDate(DateTime dateInput) // <---- This value will be null
{
return View();
}
public ActionResult CancelByDate(String dateInput) // <---- This value will be null
{
return View();
}
public ActionResult CancelByDate(object dateInput) // <---- This value will be some object, but there is no way to find out what is the underlying type even with GetType();
{
return View();
}
だから私は何が欠けているのだろうか?