私はASP.Net MVC4を使用しています.Jquery UIの日付ピッカーを使用して日付フィールドを処理しています.コードで変数を使用する方法を知りたいです.
@Html.ActionLink("新規作成", "作成")
<script>
$(function () {
$("#from").datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onSelect: function (selectedDate) {
$("#to").datepicker("option", "minDate", selectedDate);
}
});
$("#to").datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onSelect: function (selectedDate) {
$("#from").datepicker("option", "maxDate", selectedDate);
}
});
});
</script>
<p>
<label for="from">From</label>
<input type="date" id="from" name="from" value='<%=from%>'/>
<label for="to">to</label>
<input type="date" id="to" name="to" value='<%=to%>'/>
</p>
「from」/「to」フィールドから取得した値を使用して、 Controller でそれらを操作したいと思います。
public ActionResult index( )
{
DateTime first =
return View();
}