I googled the problem too many times. But I couldnt find any solution to do this.
I want to create a custom DataType
with a default EditorTemplate
and DisplayTemplate
for use in mvc3 razor.
Model
[DataType("MyCustomDataType")]
public MyType Property { get; set; }
// I mean by MyType any type of data: string, int, datetime and so on
View - Razor
@Html.DisplayFor(m => m.Property)
//or
@Html.EditorFor(m => m.Property)
Actually I want to create a reuseable datatype with default editor-template and display-template.
Do you have any suggestion please? Can you give me a useful link or if you can, a simple example please? Thanks in advance.