Reputation: 4633
I am using VS2005 C# and SQL Server 2005.
I am using the in-built ASP.NET Web Site Administration Tool in VS2005.
I have set up a few groups and a few users for my web application.
I would like to retrieve the list of users and groups from the application for my user management table in my web application.
May I know if there are any sample codes or step by step guides on the web ?
Upvotes: 0
Views: 153
Reputation: 94653
Use classes from System.Web.Security
namespace.
To get list of roles and users.
System.Web.Security.MembershipUserCollection users=System.Web.Security.Membership.GetAllUsers();
string[] roles = System.Web.Security.Roles.GetAllRoles();
Upvotes: 2