Я столкнулся с проблемой использования календаря в jquery (0x800a01b6 - javascript runtime error: object не поддерживает свойство или метод 'datetimepicker')
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'datetimepicker'
What I have tried:
mycode
My Laout Page
-----------------------------------
<!DOCTYPE html>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title
ul {
padding: 0;
list-style: none;
background: #f2f2f2;
}
ul li {
display: inline-block;
position: relative;
line-height: 21px;
text-align: left;
}
ul li a {
display: block;
padding: 8px 25px;
color: #333;
text-decoration: none;
}
ul li a:hover {
color: #fff;
background: #939393;
}
ul li ul.dropdown {
min-width: 100%; /* Set width of the dropdown */
background: #f2f2f2;
display: none;
position: absolute;
z-index: 999;
left: 0;
}
ul li:hover ul.dropdown {
display: block; /* Display the dropdown */
}
ul li ul.dropdown li {
display: block;
position: relative;
}
<div class="container">
<section class="box">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"></a>
</div>
<ul>
<li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li> <a href="#">Products</a>
<ul class="dropdown">
<li> @Html.ActionLink("ModalPopUp", "ModalPopUp", "Home")
@Html.ActionLink("Repair", "Repair", "Repair")
@Html.ActionLink("Scanning", "prescaning", "Scanning")
</li> </ul>
</li> <li><a href="#">Contact</a></li> </ul>
</div>
<div>
@RenderBody()
</div>
<div class="panel-footer">
</div>
</section>
</div>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
---------------------------End-------------
----------------------ViewPage---------------
@{
ViewBag.Title = "prescaning";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>prescaning</h2>
.button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button1 {
border-radius: 2px;
}
.button2 {
border-radius: 4px;
}
.button3 {
border-radius: 8px;
}
.button4 {
border-radius: 12px;
}
.button5 {
border-radius: 50%;
}
<div class="row">
<div>
Serial No
<div class="col-sm-3">
<div id="lbluser">
<div class="form-group">
</div>
</div>
</div>
</div>
</div>
<br>
<div class="row">
<div>
CardSerialNo
<div class="col-sm-3">
<div id="lbluser">
<div class="form-group">
</div>
</div>
@*@Html.TextBox("txtCardSNO", null, new { @class = "form-control", maxlength = 30 })*@
</div>
</div>
</div>
<br>
<div class="row">
<div>
FaultCode
<div class="col-sm-3">
<div class="form-group">
</div>
@*@Html.TextBox("txtFaultcode", null, new { @class = "form-control", maxlength = 30 })*@
</div>
</div>
</div>
<br>
<div class="row">
<div>
DateReceived
<div class="col-sm-3">
@*@Html.TextBox("txtDateReceived", null, new { @class = "form-control", maxlength = 30 })*@
</div>
</div>
</div>
<br>
<div class="row">
<div>
PO No
<div class="col-sm-3">
@*@Html.TextBox("txtPONO", null, new { @class = "form-control", maxlength = 30 })*@
</div>
</div>
</div>
<br>
<div class="row">
<div>
CardPartNo
<div class="col-sm-3">
@*@Html.TextBox("txtCardPartNo", null, new { @class = "form-control", maxlength = 30 })*@
</div>
</div>
</div>
<br>
<div class="modal-footer">
Save
Sign
</div>
<div>
$('#txtDateReceived').datetimepicker({
controlType: 'select',
oneLine: true,
timeFormat: 'HH:mm'
});
$(document).ready(function () {
debugger
$("#btnSave").click(function () {
var empObj = {
SERIALNO: $('#txtSerialNo').val(),
CARDSERIALNO: $('#txtCardSNO').val(),
FAULTCODE1: $('#txtFaultcode').val(),
DATE_RECEIVED: $('#txtDateReceived').val(),
PONO: $('#txtPONO').val(),
CARDPARTNO: $('#txtCardPartNo').val(),
};
$.ajax({
url: "/Scanning/Postprescaning",
data: JSON.stringify(empObj),
type: "POST",
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (result) {
debugger
alert("DATA SAVED !!");
},
error: function (errormessage) {
alert(errormessage.responseText);
}
});
});
});
</div>
---------------------------end---------------
BundleConfig class
using System.Web;
using System.Web.Optimization;
namespace WebApplication1
{
public class BundleConfig
{
// For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at https://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-1.12.0.js"));
//css
bundles.Add(new StyleBundle("~/Content/cssjqryUi").Include(
"~/Content/jquery-ui.css"));
}
}
}