SimpleMembershipProvider.ChangePassword Method

Changes the password for the specified membership account.

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


Public Overrides Function ChangePassword ( _
    username As String, _
    oldPassword As String, _
    newPassword As String _
) As Boolean
Dim instance As SimpleMembershipProvider 
Dim username As String 
Dim oldPassword As String 
Dim newPassword As String 
Dim returnValue As Boolean 

returnValue = instance.ChangePassword(username, _
    oldPassword, newPassword)
public override bool ChangePassword(
    string username,
    string oldPassword,
    string newPassword
virtual bool ChangePassword(
    String^ username, 
    String^ oldPassword, 
    String^ newPassword
) override
abstract ChangePassword : 
        username:string * 
        oldPassword:string * 
        newPassword:string -> bool  
override ChangePassword : 
        username:string * 
        oldPassword:string * 
        newPassword:string -> bool
public override function ChangePassword(
    username : String, 
    oldPassword : String, 
    newPassword : String
) : boolean


Return Value

Type: System.Boolean
true if the password is successfully changed; otherwise, false.



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.

See Also


SimpleMembershipProvider Class

WebMatrix.WebData Namespace