System.Web.Security.MembershipUser.ResetPassword Method

Resets a user's password to a new, automatically generated password.

Syntax

public virtual string ResetPassword (string answer)

Parameters

answer
Documentation for this section has not yet been entered.

Returns

The new password for the membership user.

Remarks

MembershipUser.ResetPassword(string) calls the MembershipProvider.ResetPassword(string, string) method of the membership provider referenced by the MembershipUser.ProviderName property to reset the password for the membership user to a new, automatically generated password. The new password is then returned to the caller.

If Membership.EnablePasswordReset is false, the membership provider will return an exception.

If Membership.RequiresQuestionAndAnswer is false, you can supply null for the answer parameter, or use the MembershipUser.ResetPassword overload that does not take any parameters.

If a password answer is required and an incorrect password answer is supplied, a System.Web.Security.MembershipPasswordException is thrown by the membership provider.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0