InputTime
InputTime
Custom Time
This sample shows how to customize the time items by binding to a collection.
Features
Description
This sample shows how to customize the time items by binding to a collection.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using MvcExplorer.Models; namespace MvcExplorer.Controllers { public partial class InputTimeController : Controller { public ActionResult CustomTime() { ViewBag.TimeList = new List< object > { "8:20" , "10:00" , "11:35" , "12:08" , "13:25" , "13:30" , "14:26" }; return View(); } } } |
1 2 3 4 5 6 7 8 9 10 11 | @ { var timeList = ViewBag.TimeList as List< object >; } < div > < label > @Html .Raw(Resources.InputTime.CustomTime_Text0)</ label > @ (Html.C1().InputTime().Bind(timeList).Value(DateTime.Parse( "11:35" )).Format( "H:mm" )) </ div > @section Description{ @Html .Raw(Resources.InputTime.CustomTime_Text1) } |