I use @Html.DisplayFor(x => x.SomeObject) for rendering display and editor templates.
Then I have a DisplayTemplate called SomeObject, SomeObject should be rendered different based on which view that calls DisplayFor. What is the best way of doing this? The only way I can figure out is to add some additional viewdata and send it to the display template, then based on this criteria i render the html correct.
I use @Html.DisplayFor(x => x.SomeObject) for rendering display and editor templates. Then I have
Share
Sounds like you actually need two separate Views. If there is an overlap between them (lots of same Html), you could put that in a partial they both share.