Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In ASP.NET MVC 4, I wanna use datepicker() of jQuery UI plugin in index.cshtml.
The problem is:
if I use the _Layout.cshtml( return View("index")) as masterpage, the datepicker() method doesn't work;
if I don't use the _Layout.cshtml (return PartialView("index")), the datepicker() works!
The same view, without or with the _Layout.cshtml, has different effect. Is there anything wrong in _Layout.cshtml?
The script to find the element is:
JavaScript
$(function () {
    $("#dateBegin").attr("readonly","true").datepicker();
    $("#dateEnd").attr("readonly","true").datepicker();
});
Posted
Updated 17-Dec-13 16:40pm
v2
Comments
Member 10434230 18-Dec-13 0:34am    
Check whether you are getting the elements or not, try to add some delay in above script. Let us know the result
wusir371 18-Dec-13 8:08am    
Could you show the script that add delay? Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900