[]
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.
To accomplish this, follow these steps:
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()
.Replace the default code of the Index.cshtml
file with the code given below to initialize an InputDateTime control.
@{
var today = DateTime.Now.Date;
var minDate = new DateTime(today.Year, 1, 1);
var maxDate = new DateTime(today.Year, 12, 31);
}
<div> @(Html.C1().InputDateTime().Id("idtInputDateTime").Value(today).Min(minDate).Max(maxDate))</div>
type=note
Append the folder name and view name to the generated URL (for example: http://localhost:1234/Index/index) in the address bar of the browser to see the view or link the view to the home page.