Reputation: 215
I have a View which needs to show and hide details based on the users role. I have 2 options
Im a newbie to MVC so can someone please advise what the best way is for approaching this problem.
Upvotes: 1
Views: 663
Reputation: 29664
I'd probably do different views for every role. I've found that over time the views for each role diverge in "common" content.
Upvotes: 0
Reputation: 44094
If it is something related to how the information displayed on the screen (and it sounds like it is) then it is best to keep that in the view. Personally I would use partial views and only load them when needed, this supports better reuse.
Upvotes: 1