I want to create a view that has different displays according to the role the user is in.
Should I create a different view for different roles or should I check the
I like to have full control over this in the view, and I find that:
<% if (User.IsInRole("Super User")) { %>
Hello world!
<% } %>
Works for most scenarios. It also allows you to easily do conditional formatting for other roles, e.g "Content Manager", "Registered", etc.
I do like Todd Smith's answer, because you might change the name of the Admin role, and that will require only one change, whereas, if you put the "Super User" or "Administrator" string directly in the view, you will have to change it wherever you've used the value.