I'm not sure I understand the last part. Are you getting any errors? The method will return a string array, but it doesn't matter whether you write var, string[] or String[] - it means the same in the end.
It's not necessary to import any namespaces to make it work.
No not getting any errors but would like to display the MemberGroup to which this member belongs to . But here how do i get it instead of System.string[] ?
Get Current MemberGroup
Hello everyone,
I have a website with 10 different Member Group where all members have access to certain specific content on the website.
Can somehow tell me how do i get to display the MemberGroup of a Login User ?
Still not working though
The method only takes a login name as parameter - not a user ID, so based on your code, try the following:
The method will then return a string array of the member groups the user is associated with ;)
Hi Anders,
Still the same output System.String[]. Am i missing any other Namespace apart from System.Web.Security ?
String[] r = System.Web.Security.Roles.GetRolesForUser(userName);
I'm not sure I understand the last part. Are you getting any errors? The method will return a string array, but it doesn't matter whether you write var, string[] or String[] - it means the same in the end.
It's not necessary to import any namespaces to make it work.
No not getting any errors but would like to display the MemberGroup to which this member belongs to . But here how do i get it instead of System.string[] ?
The method returns an array since a member can be a part of multiple groups.
Bu you can check for a specific member group like this:
This will require the System.Linq namespace.
You can also list all the groups like this:
Yes you right. Thanks for the help
is working on a reply...