ASP.NET
Membership
Login
Controls:
ASP.NET simplifies the user creation
and management process by providing the following Login controls:
- Login
Provides UI. Provides Authentication Code.
Implement Authenticate Event for custom user authentication.
- LoginView
Display info in it for authenticated users.
- LoginStatus
Logout for Authenticated users and Login
link for unauthenticated users.
- LoginName
Display name of authenticated user.
- PasswordRecovery
Password retrieval by sending email or
asking Secret Q/A.
- CreateUserWizard
- ChangePassword
Additionally
one can place ValidationSummary control on page for detailed error reporting.
System.Web.Security.Membership
class:
Membership
class provides the following methods:
CreateUser, DeleteUser,
FindUserByEmail, FindUserByName, GeneratePassword, GetAllUsers,
GetNumberOfUsersOnline, GetUser, GetUserNameByEmail, UpdateUser,
ValidateUser.
System.Web.Security.Roles
class:
RoleManagement
consist of a set of classes and interfaces that establish role for the current
user and manage role information.
Roles
class provides the following methods:
AddUserToRole, AddUserToRoles,
AddUsersToRole, and AddUsersToRoles.
CreateRole, DeleteRole,
FindUsersInRole, GetAllRoles, GetRolesForUser, IsUserInRole.
RemoveUserFromRole, RemoveUsersFromRole,
RemoveUserFromRoles, RemoveUsersFromRoles.
Roles
class can’t be used for Active Directory or windows account and roles.
Configuring
Web Applications to Use ASP.NET Membership:
Select Web Site |
ASP.Net Configuration. Login Page must be named Login.aspx