Hi Torbian,
We have analyzed your query.The issue ”
the user picks another date, the datepicker is not valid anymore” is might have occurred because datatype mismatch while passing the date to the datepicker control.To resolve this issue,please specify the date datatype as string as shown below in model,
<code>
public class DateExample
{
public string dt { get; set; }
}
</code>
Please use the below code to set the value in datepicker control,
<code>
public ActionResult DatePickerFeatures()
{
DatePickerProperties datemodel = new DatePickerProperties();
datemodel.Locale = "en-US";
datemodel.DateFormat = "dd.MM.yyyy";
ViewData["date"] = datemodel;
DateExample d = new DateExample();
d.dt = System.DateTime.Now.ToString();
return View(d);
}
</code>
Also, we have modified your sample based on this and its available under the following location,
Sample: Sample
Please let us know if you need any assistance.
Regards,
Kasithangam