title: How to add additional fields to register page in asp.net mvc?
body: <p>I am trying to add a few extra fields to the register page in the default asp.net mvc application that we get when we open visual studio. I followed this tutorial.</p>
  
  <p><a href="http://blog.falafel.com/customize-mvc-5-application-users-using-asp-net-identity-2-0/" rel="nofollow noreferrer">Customize MVC 5 Register Page</a></p>
  
  <p>These are the steps that I followed after opening the default project that we get in Visual studio for asp.net MVC.</p>
  
  <ol>
  <li><p>First I ran the project and clicked on Register button and registered a random user. I did this so that the default database would get created.</p>
  
  <p><a href="https://i.stack.imgur.com/usCmx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/usCmx.png" alt="enter image description here"></a> </p>
  
  <ol start="2">
  <li>Now that the database was generated, I went to the database and added extra columns like Gender, Birthday, FirstName, LastName and AboutUser and re-updated the database table called ASPNETUSERS.</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/k6qsT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k6qsT.png" alt="enter image description here"></a></p>
  
  <ol start="3">
  <li>Now I went to RegisterViewModel and added these same properties as well. </li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/ZwW5T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZwW5T.png" alt="enter image description here"></a></p>
  
  <ol start="4">
  <li>After that I went to ApplicationUser and added the same properties as well.</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/98YLA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/98YLA.png" alt="enter image description here"></a></p>
  
  <ol start="5">
  <li><p>After that I changed the view for Register.cshtml to incorporate extra textboxes, textareas for the new fields that I created.</p></li>
  <li><p>Now I went to the controller and added these properties in as well. Everything seems fine to me so far, except the fact that the database's definition changed from the beginning.</p></li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/CzJ6n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CzJ6n.png" alt="enter image description here"></a></p></li>
  </ol>
  
  <p>This is how the page looks after all these changes.</p>
  
  <p><a href="https://i.stack.imgur.com/BzFpW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BzFpW.png" alt="enter image description here"></a></p>
  
  <p>Now I ran the project and tried to register a person, but I keep getting this error. </p>
  
  <p><a href="https://i.stack.imgur.com/EO2w7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EO2w7.png" alt="enter image description here"></a></p>
  
  <p>I researched about this error, but the solutions suggest that I should try adding <code>Database.SetInitializer&lt;YourDbContext&gt;(null);</code> in the constructor of myDBContext. But the thing is, I don't have any context at all. So this solution doesn't seem to work for me.</p>