InputDate
InputDate
Overview
Features
Sample
Description
This sample shows the basic usage of the InputDate control.
Source
IndexController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MvcExplorer.Controllers { public partial class InputDateController : Controller { public ActionResult Index() { return View(); } } }
Index.cshtml
@{ var today = DateTime.Now.Date; var minDate = new DateTime(today.Year, 1, 1); var maxDate = new DateTime(today.Year, 12, 31); } @section Scripts{ <script> function changeDate(sender, e) { wijmo.Control.getControl("#idcCalendar").value = sender.value; } </script> } <p> @(Html.C1().Calendar().Id("idcCalendar") .Value(today).Min(minDate).Max(maxDate) .Width(300) ) </p> <div> <label>Select a date</label> @(Html.C1().InputDate().Id("idcInputDate") .Value(today).Min(minDate).Max(maxDate).OnClientValueChanged("changeDate") ) </div> @section Description{ @Html.Raw(Resources.InputDate.Index_Text0) }
Documentation