Solve the problem of automatically having access to a Web site after implementing a registered user (3)--Creating a user
Summary
This article will record how to solve the third part of automatically having access to a Web site after implementing a registered user.
Before all the preparations have been done, now we have to solve the implementation of registered users, automatically have access to the Web site's last step to set the right!
Body
The implementation process for each step is documented below.
1, first we open the project created in the previous article, open register.aspx in design mode, select the CreateUserWizard control, then click Properties on the right, click on the Events icon on the toolbar of the Properties pane, Double-click Createduser to create a Createduser event for the control.
2, in the Createduser event, we add the following code:
Copy content to Clipboard code:
1 Roles.addusertorole (Createuserwizard1.username, "members");