i am using membership provider to get roles for开发者_运维技巧 the user that logged in to my application. But, i wonder how i am hiding/showing html items on the screen based on that roles?
** I am using viewModel for each of my views in the application.
Thanks..
If your app is in ASP.NET MVC, Use this:
<% if(Roles.IsUserInRole("myRole")) { %>
<!-- show my html -->
<% } else { %>
<!-- show something else -->
<% } %>
精彩评论