Hi,
I am using the jquery datepicker function on a mvc Html.Textbox, which is bound to my model, the first time I press my search button it gets the correct date in my model, however if I press search again, it should return a different date from the model but it doesn't - it stays cached as the same date that came the first time. I debugged and checked my model contains a new date which it does, but it still shows the old date, I think this is to do with the jquery datepicker setup, how can I stop it from caching this first date?
Here is my MVC code and jquery call:
<%= Html.TextBox("MyDate",Model.listOfLoan[i].MyDate.ToShortDateString(), new {@class = "datep"}) %>
<script language="text/javascript" type="text/javascript">
$(document).ready(function() {
$('.datep').datepicker({ dateFormat: 'dd/mm/yy' });
});
</script>
When I debug, the model date has the correct date but it always shows the last date! THanks