我的mvc中的日期时间不起作用? [英] date time is not working in my mvc?
本文介绍了我的mvc中的日期时间不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
@ {
ViewBag.Title =testdatetime;
Layout =〜/ Views / Shared / _Layout.cshtml;
}
< link href = 〜/ Content / themes /base/jquery.ui.datepicker.css\" rel = 样式表 / >
< link href = 〜/ Content / themes / base / jquery.ui.all.css < span class =code-attribute> rel = stylesheet / >
< script src = 〜/ Scripts / jquery-1.7.1.min.js > < / script < span class =code-keyword>>
< script src = 〜/ Scripts / jquery-1.7.1.js > < / script >
< ; 跨度> script src = 〜/ Scripts / jquery-ui-1.8.20.js > < / script >
< link href = 〜/ Content / themes / base / jquery .ui.theme.css rel = stylesheet / >
@ * < script src = 〜/ Scripts / jquery-ui-1.8.20.min.js > < span class =code-keyword>< / script > * @
< link href = 〜/ Content / themes / base / jquery.ui .core.css rel = 样式表 / < span class =code-keyword>>
< link href = 〜/ Content / Site.css rel = 样式表 / >
< script src = 〜/ Scripts / jquery.datetimepicker.js > < / script >
< 脚本 >
$(功能) ion(){
$('。datepicker')。datepicker();
}
);
< / script >
< h2 > testdatetime < / h2 >
@using(Html.BeginForm())
{
< 输入 类型 = text class = datepicker / >
}
解决方案
('。datepicker')。datepicker();
}
);
< / script >
< h2 > testdatetime < / h2 >
@using(Html.BeginForm())
{
< 输入 类型 = text class = datepicker / >
}
更改你的全部他用以下〜引用
< script src =<%= Url.Content(〜/ Scripts / jquery。 datetimepicker.js)%> type =text / javascript>< / script>
check 在ASP.NET MVC中引用Javascript的正确方法? [ ^ ]
@{
ViewBag.Title = "testdatetime";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/Content/themes/base/jquery.ui.datepicker.css" rel="stylesheet" />
<link href="~/Content/themes/base/jquery.ui.all.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.7.1.min.js"></script>
<script src="~/Scripts/jquery-1.7.1.js"></script>
<script src="~/Scripts/jquery-ui-1.8.20.js"></script>
<link href="~/Content/themes/base/jquery.ui.theme.css" rel="stylesheet" />
@*<script src="~/Scripts/jquery-ui-1.8.20.min.js"></script>*@
<link href="~/Content/themes/base/jquery.ui.core.css" rel="stylesheet" />
<link href="~/Content/Site.css" rel="stylesheet" />
<script src="~/Scripts/jquery.datetimepicker.js"></script>
<script>
$(function () {
$('.datepicker').datepicker();
}
);
</script>
<h2>testdatetime</h2>
@using(Html.BeginForm())
{
<input type="text" class="datepicker" />
}
解决方案
(function () {
('.datepicker').datepicker(); } ); </script> <h2>testdatetime</h2> @using(Html.BeginForm()) { <input type="text" class="datepicker" /> }
Change your all the references with ~ like below
<script src="<%= Url.Content("~/Scripts/jquery.datetimepicker.js") %>" type="text/javascript"></script>
check Correct way to reference Javascript in ASP.NET MVC?[^]
这篇关于我的mvc中的日期时间不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文