c# - ASP.NET MVC Display Templates in Edit.cshtml -


i have built display template can use in of "display" pages, want use in "edit/create" pages. i'm not having luck, can instruct me how can working?

here have.

my model:

[displayformat(dataformatstring = "{0:dd/mm/yyyy}", applyformatineditmode = true)] public nullable<datetime> startdate { get; set; } 

views-shared-displaytemplates-checknulldate.cshtml

 @model datetime?  @if (model != null && model != datetime.minvalue)  {     @string.format("{0:mm/dd/yyyy}", model)  } 

views-box-index.cshtml

<td>    @html.displayfor(modelitem => item.startdate, "checknulldate") </td> 

views-box-edit.cshtml

   <div class="form-group">         <label asp-for="startdate" class="col-md-2 control-label"></label>         <div class="col-md-10">             <input asp-for="startdate" class="form-control" />             <span asp-validation-for="startdate" class="text-danger"></span>         </div>     </div> 

where/how checknulldate template in edit column "startdate"?


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -