title: Register ASP.NET
body: <p>I would like to create connection between table 1 and table 3 when I create new user. What I have to do? Probably later I will need update this and there is my another question how update Roles?</p>
  
  <p>1.</p>
  
  <p><img src="https://i.stack.imgur.com/9bdI5.png" alt="enter image description here"></p>
  
  <p>2.
  <img src="https://i.stack.imgur.com/nS3w9.png" alt="enter image description here"></p>
  
  <p>3.
  <img src="https://i.stack.imgur.com/gWS2Z.png" alt="enter image description here"></p>
  
  <p>There you have this standard control:</p>
  
  <p><img src="https://i.stack.imgur.com/pTuzH.png" alt="enter image description here"> </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Security;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace WebApplicationpomoc.Account
  {
      public partial class Register : System.Web.UI.Page
      {
  
          protected void Page_Load(object sender, EventArgs e)
          {
              RegisterUser.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"];
          }
  
          protected void RegisterUser_CreatedUser(object sender, EventArgs e)
          {
              FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);
  
  
  
              string continueUrl = RegisterUser.ContinueDestinationPageUrl;
              if (String.IsNullOrEmpty(continueUrl))
              {
                  continueUrl = "~/";
              }
              Response.Redirect(continueUrl);
          }
  
      }
  }
  
  
  &lt;%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
      CodeBehind="Register.aspx.cs" Inherits="WebApplicationpomoc.Account.Register" %&gt;
  
  &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
      &lt;asp:CreateUserWizard ID="RegisterUser" runat="server" EnableViewState="false" OnCreatedUser="RegisterUser_CreatedUser"&gt;
          &lt;LayoutTemplate&gt;
              &lt;asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
              &lt;asp:PlaceHolder ID="navigationPlaceholder" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
          &lt;/LayoutTemplate&gt;
          &lt;WizardSteps&gt;
              &lt;asp:CreateUserWizardStep ID="RegisterUserWizardStep" runat="server"&gt;
                  &lt;ContentTemplate&gt;
                      &lt;h2&gt;
                          Create a New Account
                      &lt;/h2&gt;
                      &lt;p&gt;
                          Use the form below to create a new account.
                      &lt;/p&gt;
                      &lt;p&gt;
                          Passwords are required to be a minimum of &lt;%= Membership.MinRequiredPasswordLength %&gt; characters in length.
                      &lt;/p&gt;
                      &lt;span class="failureNotification"&gt;
                          &lt;asp:Literal ID="ErrorMessage" runat="server"&gt;&lt;/asp:Literal&gt;
                      &lt;/span&gt;
                      &lt;asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification" 
                           ValidationGroup="RegisterUserValidationGroup"/&gt;
                      &lt;div class="accountInfo"&gt;
                          &lt;fieldset class="register"&gt;
                              &lt;legend&gt;Account Information&lt;/legend&gt;
                              &lt;p&gt;
                                  &lt;asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName"&gt;User Name:&lt;/asp:Label&gt;
                                  &lt;asp:TextBox ID="UserName" runat="server" CssClass="textEntry"&gt;&lt;/asp:TextBox&gt;
                                  &lt;asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" 
                                       CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                                       ValidationGroup="RegisterUserValidationGroup"&gt;*&lt;/asp:RequiredFieldValidator&gt;
                              &lt;/p&gt;
                              &lt;p&gt;
                                  &lt;asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email"&gt;E-mail:&lt;/asp:Label&gt;
                                  &lt;asp:TextBox ID="Email" runat="server" CssClass="textEntry"&gt;&lt;/asp:TextBox&gt;
                                  &lt;asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" 
                                       CssClass="failureNotification" ErrorMessage="E-mail is required." ToolTip="E-mail is required." 
                                       ValidationGroup="RegisterUserValidationGroup"&gt;*&lt;/asp:RequiredFieldValidator&gt;
                              &lt;/p&gt;
                              &lt;p&gt;
                                  &lt;asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password"&gt;Password:&lt;/asp:Label&gt;
                                  &lt;asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"&gt;&lt;/asp:TextBox&gt;
                                  &lt;asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" 
                                       CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." 
                                       ValidationGroup="RegisterUserValidationGroup"&gt;*&lt;/asp:RequiredFieldValidator&gt;
                              &lt;/p&gt;
                              &lt;p&gt;
                                  &lt;asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword"&gt;Confirm Password:&lt;/asp:Label&gt;
                                  &lt;asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"&gt;&lt;/asp:TextBox&gt;
                                  &lt;asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification" Display="Dynamic" 
                                       ErrorMessage="Confirm Password is required." ID="ConfirmPasswordRequired" runat="server" 
                                       ToolTip="Confirm Password is required." ValidationGroup="RegisterUserValidationGroup"&gt;*&lt;/asp:RequiredFieldValidator&gt;
                                  &lt;asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                       CssClass="failureNotification" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                                       ValidationGroup="RegisterUserValidationGroup"&gt;*&lt;/asp:CompareValidator&gt;
                              &lt;/p&gt;
                          &lt;/fieldset&gt;
                          &lt;p class="submitButton"&gt;
                              &lt;asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User" 
                                   ValidationGroup="RegisterUserValidationGroup"/&gt;
                          &lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/ContentTemplate&gt;
                  &lt;CustomNavigationTemplate&gt;
                  &lt;/CustomNavigationTemplate&gt;
              &lt;/asp:CreateUserWizardStep&gt;
          &lt;/WizardSteps&gt;
      &lt;/asp:CreateUserWizard&gt;
  &lt;/asp:Content&gt;
  </code></pre>