开发者

ASP NET mvc 2 Template for EditorFor and DisplayFor

开发者 https://www.devze.com 2023-01-21 12:58 出处:网络
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 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)

0

精彩评论

暂无评论...
验证码 换一张
取 消