Creates a new user profile entry and a new membership account.
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
'Declaration Public Shared Function CreateUserAndAccount ( _ userName As String, _ password As String, _ propertyValues As Object, _ requireConfirmationToken As Boolean _ ) As String 'Usage Dim userName As String Dim password As String Dim propertyValues As Object Dim requireConfirmationToken As Boolean Dim returnValue As String returnValue = WebSecurity.CreateUserAndAccount(userName, _ password, propertyValues, requireConfirmationToken)
- Type: System.String
The user name.
- Type: System.String
The password for the user.
- Type: System.Object
(Optional) A dictionary that contains additional user attributes. The default is Nothing.
- Type: System.Boolean
(Optional) true to specify that the user account must be confirmed; otherwise, false. The default is false.
Return ValueType: System.String
A token that can be sent to the user to confirm the user account.
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.
This method creates a new entry in the user profile table and then a corresponding entry in the membership table. The ID of the membership entry is based on the ID of the user profile entry. (The IDs of the entries in the two tables match.)
If you are manually maintaining the user profile table and want to create only a membership table entry for the user, call the CreateAccount(String, String, Boolean) method instead.
You can pass true for requireConfirmationToken in order require that the user account must be confirmed by the user. To confirm the account, you get the token as the return value from this method. You then send an email message to the user that contains a link whose URL contains the token. When the user clicks the link, the request is sent to your application, where you extract the token from the link and then call the ConfirmAccount(String) method.