[]
The following quick start guide is intended to get you up and running with the DateTimePicker control. In this quick start, you'll start with creating a new application, add the DateTimePicker control to it, configure the DateTimePicker control and display today's date and time on it.
type=note
Note: Blazor Server App or server-side app can be created using the Blazor Server App template. For more details, see Blazor Server topic under Blazor Project Types.
In the Solution Explorer, right click Dependencies and select Manage NuGet Packages.
In NuGet Package Manager, select nuget.org as the Package source.
Search for C1.Blazor.DateTimeEditors package and click Install.
Navigate to the wwwroot, open index.html file.
Register the client resources by adding the following lines of code to the <head> tag.
<link rel="stylesheet" href="/_content/C1.Blazor.Core/styles.css" />
<link rel="stylesheet" href="/_content/C1.Blazor.Calendar/styles.css" />
<link rel="stylesheet" href="/_content/C1.Blazor.DateTimeEditors/styles.css" />
<link rel="stylesheet" href="/_content/C1.Blazor.Input/styles.css" />
Add the following code to the <body> tag.
<script src="/_content/C1.Blazor.Core/scripts.js"></script>
<script src="/_content/C1.Blazor.Calendar/scripts.js"></script>
<script src="/_content/C1.Blazor.Input/scripts.js"></script>
Right click on Pages folder, click Add | Razor Component to add a new Razor page and then provide a name, say DateTimePickerQuickStart.
Display today's date and time in the DateTimePicker control by simply using the Value property of the C1DateTimePicker class as shown in the following code:
@page "/DateTimePicker/Index"
@using C1.Blazor.Core
@using C1.Blazor.DateTimeEditors
@using System;
@using C1.Blazor.Input
<C1DateTimePicker Value="DateTime.Today"></C1DateTimePicker>