I find myself writing a lot of code in my views that looks like the code below. In this case, I want to add some explanatory HTML for a novice, and different HTML for an expert user.
<% if (ViewData["novice"] != null ) { %>
some extra HTML for a novice
<% } else { %>
some HTML for an expert
<% } %>
This is presentation logic, so it makes sense that it is in a view vs the controller. However, it gets ugly really fast, especially when ReSharper wants to move all the braces around to make it even uglier (is there a way to turn that off for views?).
My question is whether this is proper, or should I branch in the controller to two separate views? If I do two views, I will have a lot of duplicated HTML to maintain.
Or should I do two separate views with a shared partial view of the stuff that is in common?