Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SimpleMembershipProvider.GetPassword Method

Returns the password for the specified user account from the data source.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

'Declaration
Public Overrides Function GetPassword ( _
	username As String, _
	answer As String _
) As String
'Usage
Dim instance As SimpleMembershipProvider 
Dim username As String 
Dim answer As String 
Dim returnValue As String 

returnValue = instance.GetPassword(username, _
	answer)

Parameters

username
Type: System.String
The user to retrieve the password for.
answer
Type: System.String
The answer for the password security question.

Return Value

Type: System.String
The password for the specified user account.

ExceptionCondition
NotSupportedException

EnablePasswordRetrieval is false.

MembershipPasswordException

answer does not match the security answer for the user account and RequiresQuestionAndAnswer is true.

NoteNote

If the SimpleMembershipProvider class has been initialized using a call to the WebSecurity.InitializeDatabaseConnection method, this method is not supported and will throw a NotSupportedException exception. However, if the WebSecurity.InitializeDatabaseConnection method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider. For more information, see the SimpleMembershipProvider class overview.

Show:
© 2015 Microsoft