Question

I would like to control 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.

Was it helpful?

Solution

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top