I am really fresh to kendo and MVC.
This is my Index.cshtml file. I am trying to send new startDate and endDate to my controller . but looks like I am doing something wrong.
I am trying to figure out how to post the change from datetimepicker towards my controller.
@using Kendo.Mvc.UI
@{
ViewBag.Title = "New Measurement Period";
}
<h1> New Measurement Period</h1>
<div>
<label for="start">Start Date:</label>
@(Html.Kendo().DateTimePicker()
.Name("startDate")
.Value(DateTime.Now)
.HtmlAttributes(new { style = "width: 100%", title = "datetimepicker" })
.DateInput()
)
<label for="end">End Date:</label>
@(Html.Kendo().DateTimePicker()
.Name("endDate")
.Value(DateTime.Now)
.HtmlAttributes(new { style = "width: 100%", title = "datetimepicker" })
.DateInput()
)
@(Html.Kendo().Button()
.Name("primaryTextButton")
.HtmlAttributes(new { type = "button"})
.Content("Submit"))
<script>
$(document).ready(function () {
// create DateTimePicker from input HTML element
$("#datetimepicker").kendoDateTimePicker({
value: new Date(),
dateInput: true
});
});
</script>
</div>