Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC 3 Editor Template with DateTime

Tags:

I want to change this code from MVC2

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %>    <%=Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class = "datePicker" }) %> 

To MVC 3 using Razor.

You can find the full post of what I want to do here

like image 305
roncansan Avatar asked Nov 22 '10 20:11

roncansan


1 Answers

@model DateTime?  @Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class = "datePicker" }) 
like image 66
Fabian Avatar answered Sep 27 '22 22:09

Fabian