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:

http://weblogs.asp.net/fredriknormen/archive/2008/03/12/asp-net-mvc-framework-2-interception-and-creating-a-role-action-filter.aspx


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -