I have several partial views that should be displayed when the user has a specific role.
Now I want to not do something like
<% if(user is in role){..here goes the html.. }%>
I would like to be able to do (at the top of ascx):
<% this.RenderOnlyForRoles(list of roles) %>
Now in BasePartialView I have a list of roles that populates when I call RenderOnlyForRoles.
The problem is that RenderOnlyForRoles is called after .. all the events that I can think of :), and I cannot stop the rendering of the control.
Any ideas on how to get what I want?
EDIT: Does anyone know if other views can support this?
source
share