I am using a jquery datepicker in my ASP.NET MVC4 Web app. I am also using an editor template for my datetime data type.
My editor template looks like this:
<input type="text" name="@ViewData.ModelMetadata.PropertyName" class="date" value='@(((DateTime)Model).ToShortDateString())' />
My code for jquery date picker:
$(document).ready(function() {
$(".date").datepicker();
})
The problem I am running into is that when I load date from the database, the date picker highlights today's date instead of the date in the textbox. How do I get the date picker to highlight the date I loaded into the textbox?