Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
JavaScript
using 
<script type="text/javascript">
    $(document).ready(function () {
        $('.dateTime').datepicker({ dateFormat: "dd/mm/yy" });
    });
</script>
 @Html.TextBox("DOB", Model.DOB.ToString("dd/mm/yy"), new { @class = "dateTime" })

when i do this this show the datepicker

when i use this to bind the value to model
C#
@Html.EditorFor(m=>m.DOB, Model.DOB.ToString("dd/mm/yy"), new { @class = "dateTime" })


den datepicker is disable what going on with this datepicker jquery ui?
Posted
Updated 23-May-12 23:20pm
v2

1 solution

Try:
HTML
@Html.EditorFor(m=>m.DOB, Model.DOB, new { @class = "dateTime" })


Further, have a look at this blogpost on how to add a datepicker in MVC usng jQuery: ASP.NET MVC 3: Integrating with the jQuery UI date picker and adding a jQuery validate date range validator[^]
 
Share this answer
 

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