User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 331,472 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,045 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Mar 2nd, 2008
Views: 844
Web site Administration Tool is accessible only from the hosting server. Many times programmers won't have direct access to the the hosting server. So knowledge of ASP.Net Membership classes is an added advantage in creating an administrative module for the site.
In this code snippet we will take up:
1. Listing all roles
2. Creating a role
3. Listing all users
4. Deleting a user
5. Listing Number of users online
Last edited : Mar 26th, 2008.
aspnet Syntax
  1. 1.
  2. lstRoles.DataSource = Roles.GetAllRoles();
  3. DataBind();
  4.  
  5. 2.
  6. Roles.CreateRole("Admin");
  7.  
  8. 3.
  9. lstUsers.DataSource = Membership.GetAllUsers();
  10. DataBind();
  11.  
  12. 4. Membership.DeleteUser("Anish");
  13.  
  14. 5.
  15. Mebership.GetNumberOfUsersOnline();
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 8:38 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC