ASP NET mvc 2 Template for EditorFor and DisplayFor
I would like to c开发者_运维百科ontrol or customise the output generated by DisplayFor and EditorFor so it doesn't render the default html css tags for example: .......
I would like this to be for all views not just a type or system type? And what is the simplest solution?
Any help would be appreciated.
You can always create a custom DisplayFor/EditorFor *.asxc file that resides in either Shared/DisplayTemplates or -/EditorTemplates
, pass the relevant type to it and just render what you want.
Following article explains it in further details:
(This introduces the DisplayFor method - EditorFor works exactly the same way)
精彩评论