デートピッカーの配線に関する問題
部分表示のコード
@model System.DateTime
@Html.TextBox("", Model.ToString("dd/MM/yy"), new { @class = "date" })
ビューのコード
@Html.TextBox("DateTime", (Model.AdvertStartDate.ToString()), new { @class = "date" })
スクリプト
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
日付ピッカーに使用されるコード
<script type="text/javascript">
$(document).ready(function () {
$('.date').datepicker
({
dateFormat: 'dd/mm/yy',
showStatus: true,
showWeeks: true,
currentText: 'Now',
autoSize: true,
gotoCurrent: true,
showAnim: 'blind',
highlightWeek: true
});
});
</script>
モデルのコード
[Required]
public DateTime AdvertStartDate { get; set; }
日付はテキストボックスに挿入されていますが、データベースでは更新されていません
足りないものを提案できますか?