I have written my own Register.aspx which replaces the original when my project is built.
One of the things it captures is PhoneNumber and it stores this in SiteUser.PhoneNumber.
Like FirstName and LastName, this field then gets stored in [dbo].[mp_Users]. It makes things a lot simpler and quicker for reporting pruposes if PhoneNumber can be stored linearly in the Users table as opposed to the UserProperties table.
I don't want to have to replace UserProfile.aspx so to make sure this field is available there, in my Profile.config file, I define it just like FirstName and LastName:
<add name="FirstName"
type="System.String"
allowMarkup="false"
resourceFile="ProfileResourceCRC"
labelResourceKey="FirstName"
lazyLoad="false"
showOnRegistration="true"
requiredForRegistration="true"
maxLength="100"
columns="45"
onlyAvailableForRoles=""
onlyVisibleForRoles=""
includeHelpLink="false"
cssClass="widetextbox"
/>
<add name="LastName"
type="System.String"
allowMarkup="false"
resourceFile="ProfileResourceCRC"
labelResourceKey="LastName"
lazyLoad="false"
showOnRegistration="true"
requiredForRegistration="true"
maxLength="100"
columns="45"
onlyAvailableForRoles=""
onlyVisibleForRoles=""
includeHelpLink="false"
cssClass="widetextbox"
/>
<add name="PhoneNumber"
type="System.String"
allowMarkup="false"
resourceFile="ProfileResourceCRC"
labelResourceKey="PhoneNumber"
lazyLoad="false"
showOnRegistration="true"
requiredForRegistration="false"
maxLength="100"
columns="45"
onlyAvailableForRoles=""
onlyVisibleForRoles=""
includeHelpLink="false"
cssClass="widetextbox"
/>
This causes the field to show on UserProfile.aspx but while FirstName and LastName are being loaded from [dbo].[mp_Users], it is attempting to load PhoneNumber from [dbo].[mp_UserProperties] and so it is showing an empty field.
When I enter a value and click save, it now saves it to the table where I don't want it to appear ([dbo].[mp_UserProperties]) instead of overwriting the value that I signed up with in [dbo].[mp_Users]
It appears that PhoneNumber is being treated as an extensible property instead of one of the default properties (like FirstName and LastName)
This should be an easy fix that requires two small changes to SiteUser.cs
Within public void SetProperty(String propertyName, Object propertyValue, SettingsSerializeAs serializeAs, bool lazyLoad), add the following case block:
case "PhoneNumber":
if (propertyValue is String)
{
this.PhoneNumber = propertyValue.ToString();
this.Save();
}
break;
Within public void GetProperty(String propertyName, SettingsSerializeAs serializeAs, bool lazyLoad), add the following case block:
case "PhoneNumber":
return this.PhoneNumber;
Do you think this can be included as part of the next release?
Thanks!