I have tried to find documentation or samples on how to incorporate razor editor templates into a project. the following answer on another thread may fix a problem I am having but I do not know how to incorporate it into my project. It is no doubt easy.
here is the solution I do not know how to incorporate: Client-side validation of input type date does not work
Here is short info about adding EditorTemplate
. In short words - you have to create directory EditorTemplates in Views/Shared and you should create a view with the same name as the model you want to create the editor for.
Remember that EditorTemplate
for a model is used when calling Html.EditorFor
with object of this model as argument. You should use them to provide editing possibilities, of course - if you want to create something that should only display data, use the same way to create DisplayTemplate
(create DisplayTemplates directory). DisplayTemplate
is rendered on Html.DisplayFor
call with object of this model as argument.