TextBoxFor <、>(expression、htmlAttributes)を使用して、DateTimeの日付部分のみをテキストボックスに表示できません。
モデルはLinq2SQLに基づいており、フィールドはSQLおよびエンティティモデルのDateTimeです。
失敗:
<%= Html.TextBoxFor(model => model.dtArrivalDate, String.Format("{0:dd/MM/yyyy}", Model.dtArrivalDate))%>
このトリックは廃止されているようで、オブジェクトhtmlAttributeの文字列値は無視されます。
失敗:
[DisplayFormat( DataFormatString = "{0:dd/MM/yyyy}" )]
public string dtArrivalDate { get; set; }
「00:00:00」の部分はなく、詳細/編集ビューに日付の部分のみを保存して表示したいと思います。