Example of Default Functionalities in ASP.NET MVC TimePicker Control
The following sample demonstrates the default functionalities of the TimePicker. Click/Touch the TimePicker popup icon to select a desired time and the selected time value will be displayed in the TimePicker element.
@Html.UiTimePicker("timepicker", new UiTimePickerOptions { Placeholder = "Select a time" })
<style>
.control_wrapper { display: block; margin: 0 auto; max-width: 300px; padding: 5% 0; }
.tabs-wrap { padding: 0 0 10px; }
</style>
<div class="control-section">
<div class="control_wrapper">
<div class="tabs-wrap">
<div class="wrap">
@Html.UiTimePicker("timepicker", new UiTimePickerOptions { Placeholder = "Select a time" })
</div>
</div>
</div>
</div>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class TimePickerController : Controller
{
// The page is Views/TimePicker/DefaultFunctionalities.cshtml; it draws what ViewData holds.
public ActionResult DefaultFunctionalities()
{
return View();
}
}
}
@* Install once: Install-Package Lumen.UI.Mvc (or: dotnet add package Lumen.UI.Mvc) *@
@* Views/Web.config: <add namespace="Lumen.UI.Mvc" /> *@
@* Views/Shared/_Layout.cshtml *@
<head>
@Html.UiStyles()
<link rel="stylesheet" href="~/Content/site.css" />
</head>
<body>
@RenderBody()
@Html.UiScripts()
@RenderSection("scripts", required: false)
</body>
A TimePicker is an interactive component that provides an option to select a value from popup list or set a desired time value.