asp.net mvc - Why online Jquery Datepicker work, but local Jquery Datepicker not work in MVC project -
i have issue in mvc project.
i tested in create.cshtml add code :
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <script> $(function() { $( "#datepicker" ).datepicker(); });
and textbox input :
<input type="text" id="datepicker">
and worked, when click or keypress on textbox, datepicker popup show up.
but when want javascript , css file run locally in pc put in _layout.cshtml (behave general in page) :
@scripts.render("~/scripts/jquery-1.9.1.js") @scripts.render("~/scripts/jquery-ui.js") @styles.render("~/content/themes/base/jquery-ui.css") @rendersection("scripts", required: false)
and remark direct link jquery online (source) in create.cshtml , after run page doesn't show datepicker, missing issue ?
ps: save jquery-1.9.1.js , jquery-ui.js , jquery-ui.css in local pc
because path of file missing on local.
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
change to
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
Comments
Post a Comment