SharePoint 2019 - Creating Custom Columns For The FBA Membership Request



I have an issue that I need assistance with. I want to add more columns to the membership request web part like address, a drop down for license category and company name. I was able to create the fields in visual studio but I’m not sure which backend file I need to edit so that these are submitted to the database. Also do I need to create these additional columns in the database or they are just added automatically when I create the solution. If possible, is there a step by step approach for achieving this.

Thank you.


Usually when I make field customizations they are only for SharePoint, so instead of saving them back to the membership database I save them to the user’s profile in SharePoint. If you do want to store the profile properties in the membership database, take a look at the Profile Provider:


Ok. Thank so much for the response. I am new developer in SharePoint so I only thought that new columns can be created only on the database.

So if I am to save the profiles in SharePoint. How best can I achieve that, and will that still link with data in the membership database.

Thank You.



Here’s some sample code for updating the user profile for an SPUser:

spuser.Email = txtEmail.Text;
spuser.Name = txtFullName.Text;


SPListItem userItem = this.Web.SiteUserInfoList.GetItemById(spuser.ID);

userItem["City"] = txtCity.Text;
userItem["State"] = txtState.Text;



Thanks let me look into that.


Hi again,

Sorry to continue asking questions on this topic, but I have a few issues that I would be really grateful if you give me more clarity on. So I have added a control “Address” on the webpart. I am trying to follow step by step for adding the backend code using an exiting column “FirstName”. My issue is that within the MembershipRequest.cs where do I exactly add the code to update the “Address” field in the SharePoint User Profile List is it within the ApproveMemberShip() method.

My sample code looks like below:

        SPUser sPUser = web.EnsureUser(request.UserName);
        SPListItem userItem = web.SiteUserInfoList.GetItemById(sPUser.ID);
        userItem["Address"] = request.Address;

I tried inserting it below this line but nothing happened

newUser = membership.CreateUser(request.UserName, request.Password, request.UserEmail, null, null, true, null, out createStatus);



You’re going to want to add it everywhere in the code that the spuser gets updated. To make sure it’s actually running properly, you can try to run it in debug mode. Or maybe add a temporary button to the webpart and have it write some messages to the screen to ensure that your code is being run.