DateTimePicker in Razor Pages
Razor Pages is an alternative to the MVC pattern that makes page-focused coding easier and more productive. This approach consists of a cshtml
file and a cshtml.cs
file (by design, the two files have the same name).
You can seamlessly integrate the Telerik UI DateTimePicker for ASP.NET Core in Razor Pages applications.
This article describes how to configure the DateTimePicker component in a Razor Pages scenario.
For the complete project, refer to the DateTimePicker in Razor Pages example.
@page
<div>
<h4>Select a date range</h4>
@(Html.Kendo().DatePicker()
.Name("datepicker")
)
</div>
@page
<div>
<h4>Select a date range</h4>
<kendo-datepicker name="datepicker">
</kendo-datepicker>
</div>
public void OnGet()
{
}