I have created a datepicker using :
@Html.TextBoxFor(model => model.DateTo, new { @class = "form-control DateTo" })
and
$(".DateTo").datepicker({
dateFormat: 'dd/mm/yy',
numberOfMonths: 1,
autoclose: true,
});
and in the view model : [Display(Name = "To")] public string DateTo { get; set; }
and have updated the field DateTo and passing that to view in the controller as:
return view(searchviewModel);
In the searchviewModel, the DateTo is set to 26/11/2014. Where as when I get the page, it is caching old values and not resetting to this value.
Any input on this will be helpful.