System.NotSupportedException: The specified method is not supported.

Can I get a user password? How please When I tried this code:

WebSecurity.InitializeDatabaseConnection("nectarys-pc.MonitoringN.dbo", "Superviseur", "UserId", "matricule", autoCreateTables: true);
var membership = (SimpleMembershipProvider)Membership.Provider;
model.motDePasse = membership.GetUser(superviseur.matricule, false).GetPassword();

This exception appears on the last line:

System.NotSupportedException: The specified method is not supported.

How to handle this?

Note that is superviseur.matriculenot the source of the problem.

+3
source share
2 answers

MSDN GetPassword , System.NotSupportedException, EnablePasswordRetrieval ."

EnablePasswordRetrieval web.config

+1

All Articles