The quick start guides you through the steps of adding an InputDateTime control to your application. For more information on how to add ASP.NET MVC Edition controls, see Adding Controls.
Follow the steps given below to get started:
Create a new MVC application using the ComponentOne or VisualStudio templates. For more information about creating an MVC application, see Configuring your MVC Application topic.
Add a new Controller:
Default1Controller
).Add a View for the controller:
Index()
.Index.cshtml
file with the code given below to initialize an InputDateTime control.
Razor |
Copy Code
|
---|---|
@{ var today = DateTime.Now.Date; var minDate = new DateTime(today.Year, 1, 1); var maxDate = new DateTime(today.Year, 12, 31); } <div> <label> Select a date </label> <c1-input-datetime id="idtInputDateTime" value="@today" min="@minDate" max="@maxDate"></c1-input- datetime> </div> |