I'm creating members in my C# code (Umbraco 4.7.1) using the System.Web.Security.Membership and System.Web.Security.MembershipUser classes and a 'MemberProfile' class derived from System.Web.Profile.ProfileBase. For some time now has been the correct way to handle members in Umbraco.
However I am using a 3 lines of code which revert back to the old and now marked as obsolete umbraco.cms.businesslogic.member.Member class as I cannot find any method of changing the member name displayed in the Umbraco backend using the profile provider (the displayed name defaults to the user name). My 'obsolete' three lines of code are:
Member member = Member.GetMemberFromEmail(email); member.Text = newUserName; member.Save();
They work though and have the desired effect, so it is not a problem as such that I am posting, but I can't help wondering if I am missing another way of handling this?
Did you find a way around using this obsolete method? I need to do exactly the same thing - set the 'Name' field in Umbraco to something other than their login name (which will be the email address).
Changing the displayed member name in C# code.
I'm creating members in my C# code (Umbraco 4.7.1) using the System.Web.Security.Membership and System.Web.Security.MembershipUser classes and a 'MemberProfile' class derived from System.Web.Profile.ProfileBase. For some time now has been the correct way to handle members in Umbraco.
However I am using a 3 lines of code which revert back to the old and now marked as obsolete umbraco.cms.businesslogic.member.Member class as I cannot find any method of changing the member name displayed in the Umbraco backend using the profile provider (the displayed name defaults to the user name). My 'obsolete' three lines of code are:
They work though and have the desired effect, so it is not a problem as such that I am posting, but I can't help wondering if I am missing another way of handling this?
I'd be interested to hear comments.
Hi Matthew
Did you find a way around using this obsolete method? I need to do exactly the same thing - set the 'Name' field in Umbraco to something other than their login name (which will be the email address).
There's a similar thread here: http://our.umbraco.org/forum/developers/api-questions/21392-Accessing-member-name
Thanks
Ben
Hi Benjamin,
I've not found an alternative. The above code works (I just get a green underline in the source) so I've left it and moved on!
Thanks
Matt.
is working on a reply...