In my ASP.NET Web Application with C#, I used the Web Site Administration tool to create users and passwords.
I do some actions in the aspx file based on roles, e.g.:
<RoleGroups>
<asp:RoleGroup Roles="Administrators">
My question is: how can I reference the roles/users created as mentioned, within the code-behind (C#) file:
E.g. If role=Administrators, do this…
If user = admin/john/whatever, do this…
Thank you!
Anna
Try this
For Users, you can get a User like this to get the currently logged in user
and there is a whole bigger Membership API you can use to do what you like.
http://msdn.microsoft.com/en-us/library/ff648345.aspx