-1
我有我的jQuery的日期驗證腳本問題,所以我安裝了jQuery全球化package.I'm到包很新的安裝包的,所以我不太清楚如何利用腳本。我試着做以下,但它仍然給了我這個錯誤。如何使用jQuery全球化包日期驗證
片段\用戶\ Create.cshtml
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm())
{ %>
<%: Html.ValidationSummary(false) %>
<%: Html.EditorForModel() %>
<p> <input type="submit" value="Create" /></p>
<% } %>
</fieldset>
}
瀏覽\用戶\ Create.cshtml
@model RecreationalServicesTicketingSystem.Models.User
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>User</legend>
<div class="editor-label">
@Html.LabelFor(model => model.LastName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.LastName)
@Html.ValidationMessageFor(model => model.LastName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.FirstMidName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.FirstMidName)
@Html.ValidationMessageFor(model => model.FirstMidName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.EnrollmentDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.EnrollmentDate)
@Html.ValidationMessageFor(model => model.EnrollmentDate)
</div>
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm())
{ %>
<%: Html.ValidationSummary(false) %>
<%: Html.EditorForModel() %>
<p> <input type="submit" value="Create" /></p>
<% } %>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
我建議你閱讀http://stackoverflow.com/questions/30917036/globalizing-date-time-format-in-mvc –
感謝您的建議! – TykiMikk