Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7037853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:35:43+00:00 2026-05-28T01:35:43+00:00

I have developed MVC web app. Now, I want to use custom form authentication

  • 0

I have developed MVC web app. Now, I want to use custom form authentication into it.
For simplicity I’m using SQL membership provider for registration stuff. But, I dont want to create other custom table and map membership table to that because I just need to create simple module i need to stick with default tables

I have generated sql membership table using Aspnet_regsql tool

Now in AccountModel.cs into RegisterModel class i have added two more fields like :

public class RegisterModel
{
   [Required]
   [Display(Name = "User name")]
   public string UserName { get; set; }

   [Required]
   [Display(Name = "First name")]
   public string FirstName { get; set; }

   [Required]
   [Display(Name = "Last name")]
   public string LastName { get; set; }
}

Also updated dbo.aspnet_Membership table and added two more fields firstname and lastname

Now inside Controllers in AccountController.cs
code :

[HttpPost]
public ActionResult Register(RegisterModel model)
{
    if (ModelState.IsValid)
    {
        // Attempt to register the user
        MembershipCreateStatus createStatus;
        Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus); 
    }
}

Here as CreateUser is default method of membership so I’m not able to insert my custom fields (firstname and lastname )into table at the time of create user ?

How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:35:44+00:00Added an answer on May 28, 2026 at 1:35 am

    Ashu, after reading your requirements, i feel you should go with coding a custom provider for yourself rather than sticking with the default. The reason I say this is that the only option you have on-hand to achieve your requirements is by following @Mystere Man’s solution.

    create a Users table in your app, make it’s primary key a GUID, and add your custom fields. When you create the user, insert a new record into your users table and use the ProviderUserKey of the MembershipUser returned from CreateUser. This is extremely simple, and does not require messing with the membership system.

    Now, if you are going to play with the membership provider, than why not make an entirely new provider for your own. It isn’t that difficult as people think it is. All you need to do is implement some abstract classes to have things accordingly.

    There are tons of tutorial available online for building a custom membership provider from scratch and i am listing few them below.

    • ASP.NET MVC Custom Membership Provider Tutorial – Part 1
    • ASP.Net MVC Custom Membership Provider with Repository Injection
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a web app in ASP.NET MVC which we are using internally.
Im trying to develop my first ASP.NET MVC web app and have run into
We have a wonderful ASP.NET MVC 2 web application using MS SQL 2008 and
I have just created a mid-sized web-application using Java, a custom MVC framework, javascript.
I have developed a MVC web application with ASP.NET MVC and im just wondering
I have developed an ASP.NET MVC 2 website, and now need to deploy it
I have developed a site with ASP.NET MVC 1, and now I'm trying to
We have an ASP.Net MVC 1.0 solution developed using Visual Studio 2008 and .net
I have a one red5 application using flex. Now I just want to develop
I have a web app written in ASP.NET MVC 3.0. There are some largish

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.