Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

WebSecurity ChangePassword Method

WebSecurity - ChangePassword()


WebSecurity Object WebSecurity object


define

ChangePassword() The method changes the password for the specified user.


C# and VB syntax

WebSecurity.ChangePassword(

userName, oldPassword, newPassword

)


Parameters

Parameters Type Description
userName String Username
oldPassword String The user's old password
newPassword String The new password

Return Value

Type Description
Boolean Returns if the password is changed true; otherwise, returns false。

Errors and exceptions

In the following cases, any access to the WebSecurity object will throw an InvalidOperationException:


Technical data

Name Value
Namespace WebMatrix.WebData
Assembly WebMatrix.WebData.dll

WebSecurity Object WebSecurity object