InputNumber
InputNumber
Editor Template
Features
Sample
Description
This sample shows the usages of the editor templates offered by C1.
You can use these templates out of the box with C1 MVC project template.
Source
EditorTemplatesController.cs
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 InputNumberController : Controller { public ActionResult EditorTemplates() { var model = new Sale { ID = 101, Start = new DateTime(2014, 4,4,17,0,0), End = DateTime.Now, Amount = 1000}; return View(model); } } }
EditorTemplates.cshtml
@model MvcExplorer.Models.Sale <div> <label>@Html.Raw(Resources.InputNumber.EditorTemplates_Text2)</label> @Html.EditorFor(m => m.Amount) @Html.EditorFor(m=> m.Start, "Time") @Html.EditorFor(m => m.End) </div> @section Description{ <p>@Html.Raw(Resources.InputNumber.EditorTemplates_Text0)</p> <p>@Html.Raw(Resources.InputNumber.EditorTemplates_Text1)</p> }
Documentation