Linked Questions

Popular Questions

I have a razor page displaying the control:

<div>
     @(Html.Kendo().DateTimePickerFor(model => model.StartDate)
        .Events(e => e.Change("endDatetimepickerChange"))
        .HtmlAttributes(new { style = "width: 49%; float: left;" }))
    @Html.ValidationMessageFor(model => model.StartDate)
    @(Html.Kendo().DateTimePickerFor(model => model.EndDate)
        .Events(e => e.Change("endDatetimepickerChange"))
        .HtmlAttributes(new { style = "width: 49%; float: right;" }))
    @Html.ValidationMessageFor(model => model.EndDate)
</div>

and the backing model has the two properties:

[BindProperty]
public DateTime StartDate { get; set; }

[BindProperty]
public DateTime EndDate { get; set; }

The page displays as expected but the model is never updated when the value is changed on the control.

Also, both of my change scripts execute when the value changes and there are no errors in the console.

What am I missing here to get this control to post the changes back to the model?

Related Questions