に設定されていません:日付時間は、私はasp.net MVC 3ビューのこの部分を持っているビュー
アクションdateOfBirthのがDatetime.minimum値に設定されているが、コントローラに<tr>
<td>@Html.LabelFor(x => x.DateOfBirth, new { @class = "lbl" }, "Date Of Birth") </td>
<td>@Html.TextBoxFor(x => x.DateOfBirth, new { @class = "w100 _dob" })
<br>@Html.ValidationMessageFor(x => x.DateOfBirth)
</td>
</tr>
public ActionResult Index(IdentifyModel identifyModel) {}
ビューのコード
@model CreditRegistry.Models.Helpers.IdentifyModel
@{
ViewBag.Title = "Identify";
ViewBag.BreadCrumb = "Identify";
}
@section BodyTitle {
<span>Identify</span> yourself
}
<ul class="extra">
<li><a href="#">Receive Free Credit Report</a></li>
<li><a href="#">Premium Subscription</a></li>
<li><a href="#">FAQ</a></li>
</ul>
@using (Html.BeginForm("Index","Identify",FormMethod.Post,new{autocomplete="off", id="frmIdentify"})) {
<p class="info">
View and print your credit report after you authenticate your identity. <u><b>Your first
credit report is free.</b></u>
</p>
<p>
Please provide as much information as you can so we can identify who you are.
Refer to the <b>@Html.ActionLink("FAQ", "FAQ", "Home")</b> for help.
</p>
@*
<p>
Is this report for an @Html.RadioButton("_mode", "_individualFields", true, new { @class = "_mode" })
Individual or a @Html.RadioButton("_mode", "_businessFields", new { @class = "_mode" })
Business?
</p>
*@
@Html.ValidationSummary()
<fieldset class="form">
<table>
<tr>
<td>@Html.LabelFor(x => x.FirstName, new { @class = "lbl" }, "First Name")</td>
<td>@Html.TextBoxFor(x => x.FirstName, new { @class = "w200" })
<br>@Html.ValidationMessageFor(x => x.FirstName)
</td>
</tr>
<tr>
<td>@Html.LabelFor(x => x.LastName, new { @class = "lbl" }, "Last Name")</td>
<td>@Html.TextBoxFor(x => x.LastName, new { @class = "w200" })
<br>@Html.ValidationMessageFor(x => x.LastName)
</td>
</tr>
<tr>
<td>@Html.LabelFor(x => x.DateOfBirth, new { @class = "lbl" }, "Date Of Birth") </td>
<td>@Html.TextBoxFor(x => x.DateOfBirth, new { @class = "w100 _dob" })
<br>@Html.ValidationMessageFor(x => x.DateOfBirth)
</td>
</tr>
<tr>
<td>(optional)@Html.LabelFor(x => x.Phone, new { @class = "lbl" }, "Mobile Number") </td>
<td>@Html.TextBoxFor(x => x.Phone, new { @class = "w200" })
<br>@Html.ValidationMessageFor(x => x.Phone)
</td>
</tr>
<tr>
<td>(optional)@Html.LabelFor(x => x.DLNumber, new { @class = "lbl" }, "Driver's License Number") </td>
<td>@Html.TextBoxFor(x => x.DLNumber, new { @class = "w200" })
<br>@Html.ValidationMessageFor(x => x.DLNumber)
</td>
</tr>
<tr>
<td>(optional)@Html.LabelFor(x => x.PassportNo, new { @class = "lbl" }, "Passport Number") </td>
<td>@Html.TextBoxFor(x => x.PassportNo, new { @class = "w200" })
<br>@Html.ValidationMessageFor(x => x.PassportNo)
</td>
</tr>
<tr>
<td>(optional)@Html.LabelFor(x => x.NationalID, new { @class = "lbl" }, "National ID") </td>
<td>@Html.TextBoxFor(x => x.NationalID, new { @class = "w200" })
<br>@Html.ValidationMessageFor(x => x.NationalID)
</td>
</tr>
</table>
<p>
<label>
</label>
<input type="submit" value="Start Identification" />
</p>
</fieldset>
}
<script type="text/javascript">
$(function() {
$('#frmIdentify').attr('autocomplete', 'off'); @*make sure autocomplete off for browsers that already stored some information*@
$('._dob').datepicker({ dateFormat: "yy-mm-dd", changeMoth: true, changeYear: true, yearRange: '-100y:c+nn' });
});
ホーwを修正できます
あなたの質問は明確ではありません –