![]()
The password for the membership user.
MembershipUser.GetPassword calls the MembershipProvider.GetPassword(string, string) method of the membership provider referenced by the MembershipUser.ProviderName property to retrieve the password for the membership from the membership data store.
If Membership.EnablePasswordRetrieval is false, the membership provider will return an exception. If the provider supports passwords with a SqlMembershipProvider.PasswordFormat of MembershipPasswordFormat.Hashed, you will be unable to retrieve the password for the membership user and should consider making use of the MembershipUser.ResetPassword method when a user has forgotten his or her password.
A System.Configuration.ConfigurationException will be thrown if enablePasswordRetrieval is set to true and passwordFormat is set to Hashed in the Web.config file for the ASP.NET application.
If Membership.RequiresQuestionAndAnswer is true, you must use the MembershipUser.GetPassword(string) overload that takes a password answer as a parameter and supply the password answer for the membership user. If a password answer is required and an incorrect password answer is supplied, a System.Web.Security.MembershipPasswordException is thrown by the membership provider.