The password for the specified user name.
Takes, as input, a user name and a password answer and retrieves the password for that user from the data source and returns the password as a string.
The MembershipProvider.GetPassword(string, string) method ensures that the MembershipProvider.EnablePasswordRetrieval flag is set to true before performing any action. If MembershipProvider.EnablePasswordRetrieval is false, a NotSupportedException exception is thrown.
MembershipProvider.GetPassword(string, string) also checks the value of the MembershipProvider.RequiresQuestionAndAnswer property. If MembershipProvider.RequiresQuestionAndAnswer is true, MembershipProvider.GetPassword(string, string) checks the value of the supplied answer parameter against the stored password answer in the data source. If they do not match, a System.Web.Security.MembershipPasswordException exception is thrown.
If your custom membership provider supports hashed passwords, the MembershipProvider.GetPassword(string, string) method should throw an exception if the MembershipProvider.EnablePasswordRetrieval property is set to true and the password format is set to Hashed. Hashed passwords cannot be retrieved.