3"> 3">
Download presentation
Presentation is loading. Please wait.
Published byKatrina Knight Modified over 9 years ago
1
1 CS 3870/CS 5870: Note 12 Membership Class
2
2 Logging in User Programmatically If Membership.ValidateUser(txtUserName.Text, txtPassword.Text) Then FormsAuthetication.RedirectFromLoginPage(...) Else lblErr.Text = “Incorrect UserName or Password!” End If
3
Invalid Password <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/> 3
4
4 Locking Out User with Bad Password If Membership.ValidateUser(txtUserName.Text, txtPassword.Text) Then FormsAuthetication.RedirectFromLoginPage(...) Else Dim user As MembershipUser = Membership.GetUser(txtUserName.Text) lblErr.Text = “Locked out value: ” & user.IsLockedout().ToString() End If
5
5 Unlocking a User Dim user As MembershipUser = MembershipGetUser(txtUserName.Text) user.UnlockUser()
6
Showing Number of Users Online Page_Load Event lblNumUsers.Text = “There are ” & Membership.GetNumberOfUsersOnline().ToString() 6
7
7 Lab5MasterPage The LoginName and LoginStatus should be displayed to the left side and right side of "Lab 5", respectively. Code (VB or C#) file Protected Sub LoginStatus1_LoggedOut(...) Handles... Response.Redirect("~/Login.aspx") End Sub
8
Lab 5 8
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.