ASP.NET MVC 4 Editor Template for basic types

前端 未结 2 2034
南旧
南旧 2020-12-02 12:15

I\'ve created a template for Number input and if I do

@Html.EditorFor(model => model.SomeValue, \"Number\")

it works fine and the templa

2条回答
  •  感动是毒
    2020-12-02 12:55

    In your Editor Template, you must have the same type Example :

    model.SomeValue is type of loremIpsumObject

    In your EditorTemplate you are :

      @model YourNamespaceWhereIsYourClass.loremIpsumObject
      ...And your code in your editorTemplate....
    

    you can find an example here for datetime

    It helps you ?

提交回复
热议问题