WebSecurity.ConfirmAccount Method

Confirms that an account is valid and activates the account.

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

public static function ConfirmAccount(
	accountConfirmationToken : String
) : boolean


Type: System.String
A confirmation token to pass to the authentication provider.

Return Value

Type: System.Boolean
true if the account is confirmed; otherwise, false.


The SimpleMembershipProvider.Initialize(String, NameValueCollection) method was not called.


The InitializeDatabaseConnection() method was not called.


The SimpleMembershipProvider membership provider is not registered in the configuration of your site. For more information, contact your site's system administrator.

The confirmation token is generated by the CreateAccount(String, String, Boolean), CreateUserAndAccount(String, String, Object, Boolean), and GeneratePasswordResetToken(String, Int32) methods. The token is ordinarily sent to the user as a link in an email message, and the user clicks the link in order to verify his or her identity.

For an example of how to use the ConfirmAccount(String) method, see the Confirm.cshtml file in the Starter Site template.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.