gymcode
gymcode

Reputation: 4633

Retrieve list of users and groupsfrom ASP.NET Web Site Administration Tool

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

Answers (1)

KV Prajapati
KV Prajapati

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

Related Questions