Cshtml 코드. 스크립트가 렌더링되지 않습니다.
$(function() {
alert("hi");
$(".datefield").datepicker();
});
을 DateTimePicker
의@Html.EditorFor(model => model.StartDate, new { htmlAttributes = new { @class = "datefield", type = "date" } })
@section Scripts {
@Scripts.Render("~/Content/css")
@Scripts.Render("~/Scripts/jquery")
}
Bundle.config 코드
bundles.Add(new ScriptBundle("~/Scripts/jquery").Include(
"~/Scripts/jqueryui1.12.s",
"~/Scripts/jqueryui-12.js",
"~/Scripts/DateTimePicket.js"
));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/jqueryui1.12.css"
));
코드는 어디 문제입니다. 이 파일 "~/Scripts/jqueryui1.12.s", "~/Scripts/jqueryui-12.js",
의 코드는
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
출신 난 그냥 날짜 선택기를 추가하려고하고 코드가 엉망이되었다.
나는 프로젝트를 공유 할 수도 있습니다. 필요하다면 ... –
나중에 공유하십시오 –
브라우저 콘솔에 오류가 있습니까? – Umamaheswaran