asp.net - How do I display a different view based on membership role? -
i brand new mvc, , i'm jumping in head first. creating time , attendance application. want user log in , see user interface clocking in. however, salaried employees want provide different interface. thought on offer 2 views, unsure of "customary" method of doing this.
for i'm using accountcontroller handle authentication, , using standard authorization attributes.
should have home controller's index action check role , return different view? or should somehow route users different actions based on membership role?
one way setup roles , use code in views:
<% if (user.isinrole("adminrole") html.renderpartial("adminview"); else if (user.isinrole("salariedrole") html.renderpartial("salaryview"); %>
you can filter:
Comments
Post a Comment