Customize UsersDisp.aspx and FBA/

FBA/Management/UsersDisp.aspx and FBA/Management/UserNew.aspx

On these pages, I have a requirement to add a new column/form entry called "Company" so that the admin can sort and modify user per company.

Right now, the listings are UserName, Email, Active, Locked, and so on. If I could add one more column for "Company" that would be great. Please let me know if this can be done and how.


It can be done. The easiest way to do it would be to search for 'email' in the code and then duplicate the email code for Company. Note that email is set both in the membership database and on the sharepoint user's profile. You'll only want to make the SharePoint profile updates for Company.
Hi, thanks for your response. I opend up the FBA/Management?UserNew.aspx code and searched for email and found the code block below:

<wssuc:InputFormSection runat="server" Title="<%$ Resources:FBAPackWebPages, EmailColHeaderText %>">
            <asp:Label ID="lblEmailMessage" runat="server" Text="" ForeColor="red"></asp:Label>
            <wssuc:InputFormControl runat="server" LabelText="<%$ Resources:FBAPackWebPages, TypeEmailAddrLabelText %>">
                <SharePoint:InputFormTextBox Title="<%$ Resources:FBAPackWebPages, EmailColHeaderText %>" class="ms-input" Columns="40" maxlength="255" ID="txtEmail" Direction="LeftToRight" Runat="server" autocomplete="off" />
                <SharePoint:InputFormRegularExpressionValidator ID="InputFormRegExpressionFieldValidator1"  ControlToValidate="txtEmail" Display="Dynamic" runat="server" ValidationExpression=".+\@.+" ErrorMessage="Enter a valid email address."/>
How would I modify this for Company?
Also curious, do I need to add to the FBAPackWebPages file for the web applicaton in question?

I got an error stating that the CompanyColHeaderText was invalid so I'm wondering if I need to add to the FBAPackWebPages file below to something similar

<data name="EmailColHeaderText" xml:space="preserve">
<value>Email Address</value>
Yeah - the "resources" items are pulling values from resource files, which you'll also find in the solution. They allow the text to be translated to multiple languages. If you're only going to be using this internally in a single language you could just replace the resource entries with the actual text you want to appear.

I'll put it out there too that we do customization for customers as well. From what you've mentioned I expect the changes can be done within the 6 hours that are included with the FBA Pack support plan, which can be purchased here:
So there is there a way add columns to the SPGridview below that resides in the UsersDisp.aspx file? When I do, I get an error on this page. Not sure how to modify the view or datasource in this file.

<SharePoint:SPGridView ID="MemberGrid" runat="server" DataSourceID="UserDataSource"
    AutoGenerateColumns="false" AllowPaging="true" PageSize="20" AllowSorting="true">
        <SharePoint:SPMenuField HeaderText="<%$ Resources:FBAPackWebPages, UserNameColHeaderText %>" TextFields="Name" MenuTemplateId="UserMenu"
            NavigateUrlFields="Name" NavigateUrlFormat="UserEdit.aspx?UserName={0}" TokenNameAndValueFields="USERNAME=Name"
            SortExpression="Name" />

        <SharePoint:SPBoundField DataField="Email" HeaderText="<%$ Resources:FBAPackWebPages, EmailColHeaderText %>" SortExpression="Email">

        <SharePoint:SPBoundField DataField="Title" HeaderText="<%$ Resources:FBAPackWebPages, FullNameColHeaderText %>" SortExpression="Title">
        <SharePoint:SPBoundField DataField="Active" HeaderText="<%$ Resources:FBAPackWebPages, ActiveColHeaderText %>" SortExpression="Active">
        <SharePoint:SPBoundField DataField="Locked" HeaderText="<%$ Resources:FBAPackWebPages, LockedColHeaderText %>" SortExpression="Locked">
        <SharePoint:SPBoundField DataField="LastLogin" HeaderText="<%$ Resources:FBAPackWebPages, LastLoginColHeaderText %>" SortExpression="LastLogin">
        <SharePoint:SPBoundField DataField="IsInSharePoint" HeaderText="<%$ Resources:FBAPackWebPages, IsInSharePointColHeaderText %>" SortExpression="IsInSharePoint">
        <SharePoint:SPBoundField DataField="Modified" HeaderText="<%$ Resources:FBAPackWebPages, ModifiedColHeaderText %>" SortExpression="Modified">
        <SharePoint:SPBoundField DataField="Created" HeaderText="<%$ Resources:FBAPackWebPages, CreatedColHeaderText %>" SortExpression="Created">

I see "Department" is part of the User Information List, is there a way to pull this column in to the gridview above and rename it to something else?
You'll want to take a look at FBADataSource and FBAUsersView - that's why I mentioned you'll need to search the whole solution for "email".
I've added the form field of "Company" for New user and Edit user (FBA), but not sure where this writes to, is it supposed to write to the membership database, and will I need to modify the stored procedure?

Also, not sure where to look to modify the FBAUsersView and FBADataSource, I only see them referenced once, which is in the UsersDisp.aspx file. Any thoughts?

I appreciate your help on this.
I would store the Company field in the SharePoint user profile.

The files are in the Code\Data folder
How would I add the Company field to the SharePoint user profile? Can this be done using Powershell?

Also, with the Code\Data folder. Do you mean in Visual Studio? I current do not have VS on the server and am not sure where you are referring to.

Nevermind about the Company field, I added it to the User Profile (under People and Groups/ List Settings).

Now I just need to tie this to the FBA piece for when I create a new user, edit user (and display users) from the FBA Management Console. I'm still a bit lost, I can add those fields in the appropriate pages, but not sure they will Update in the SharePoint List/FBA list. Will let you know if I get Errors. Still not sure where to look for the Code/Data folder, are you referencing Visual Studio?
Yeah, this is all in Visual Studio - you can't add the field just by editing the front end files. You need to edit the code. I was wondering why you couldn't find the data source if you were searching the code for 'email'. Code can be downloaded here:
Hello Ccoulson,

This webpart is being used by a very important client that I'm working for. Thye have asked to add 3 additional fields which I have managed to do. However, I now would like these fields to be included in the New User (FBAUserview.cs) and possible the Membership ReviewList.

I have tried but fail to up date the SharePoint User Info List....Could you provide me with any useful detail/code in which to do this?

We are currently using the SharePoint 2010 version of the code....Any additional information you may need, please let me know.
There's some code here that shows you how to update custom fields on the sharepoint user info list:
Thank you ever so much ccolson...I will definitely give this a go and let you know how I get on.