The Following Slides Are For Your Reference Only. Feel Free To Do More Exploration
The Following Slides Are For Your Reference Only. Feel Free To Do More Exploration
Returns a Boolean value that indicates whether the user is authenticated and authorized.
ValidateUser(username, password)
Creates a user with the specified username, password and email address.
CreateUser(username, password, email)
Returns a MembershipUser object that contains data about the currently logged-on user. Updates the last activity date-time stamp.
GetUser( )
Returns a MembershipUser object that contains data about the user with the specified username. Updates the last activity date-time stamp.
GetUser(username)
Returns a string that contains the username that corresponds with the specified email address.
GetUserNameByEmail(email)
Updates the user with the data thats stored in the specified MembershipUser object.
UpdateUser(membershipUser)
Gets the current user and updates the last activity timestamp.
MembershipUser user = Membership.GetUser( );
Deletes a user.
Membership.DeleteUser(txtUserName.Text);
The date and time when the user was added to the membership data store.
CreationDate
The date and time when the membership user was last authenticated.
LastLoginDate
The date and time when the membership user was last authenticated or accessed the application.
LastActivityDate
A Boolean value that indicates whether the membership user can be authenticated.
IsApproved
Gets the password for the membership user from the membership data store.
GetPassword( )
Updates the password for the memberhsip user in the membership data store.
ChangePassword(oldPassword, newPassword)
Updates the password question and answer for the memberhsip user in the membership data store.
ChangePasswordQuestionAndAnswer(Password,
question, answer)
MembershipUser user = Membership.GetUser(); try { user.ChangePassword(txtOldPassword.Text, txtNewPassword.Text); } catch(Exception ex) { lblStatus.Text = Error changing password: + ex.Message.; }
Issues an authentication ticket for the user and redirects the browser to the page it was attempting to access when the login page was displayed.
If the createPersistentCookie argument is true, the cookie that contains the authentication ticket is persistent across browser restarts. Otherwise, the cookie is only available for the current session.
RedirectFromLoginPage(username,
createPersistentCookie)
Logs the user off by removing the cookie that contains the authentication ticket.
Signout( )
if (Membership.ValidateUser (txtUserName.Text, txtPassword.Text)) FormsAuthentication.RedirectFromLoginPag e(txtUserName.Text, false); else lblStatus.Text = Invalid user! Try again.;
FormsAuthentication.SignOut( );
Gets a string array containing all the roles for the application.
GetAllRoles( )
try { Roles.CreateRole(txtRoleName.Text); } catch (Exception ex) { errorMessage = Error creating role: + ex.Message; }
premium);
cboRoles.SelectedValue);