we have the case that we want to let users update their profiles, email included. The issue is that once we save LoginName and Email properties, Member.GetCurrentMember() returns null due to System.Web.HttpContext.Current.User.Identity is not updated with the new username.
I'm not sure I know the answer to your question but could you please provide the code you're currently using to try and update the username? Otherwise it's a bit hard to point you in the right direction or let you know if it's a bug in the API.
If you debug after save is the member null then? Or is it that after save() the member still does not have anything assigned to LoginName and Email properties.
sorry I have been on holidays. my collegue have solved the issue... actually it was our fault because we were trying to do that by ajax calls. Now forcing the redirect to a new request, it works fine.
Updating username, GetCurrentMember() fails - Umbraco 6.1.5
Hi folks,
we have the case that we want to let users update their profiles, email included. The issue is that once we save LoginName and Email properties, Member.GetCurrentMember() returns null due to System.Web.HttpContext.Current.User.Identity is not updated with the new username.
Any suggestions?
Thanks!
Hi Emiliano and welcome to our :)
I'm not sure I know the answer to your question but could you please provide the code you're currently using to try and update the username? Otherwise it's a bit hard to point you in the right direction or let you know if it's a bug in the API.
Cheers, Jan
Member member = GetMemberById(memberId);
member.LoginName = profile.Email;
member.Email = profile.Email;
member.Save();
member.XmlGenerate(new XmlDocument());
Hi Emiliano,
When is the member null?
If you debug after save is the member null then? Or is it that after save() the member still does not have anything assigned to LoginName and Email properties.
What are the values of LoginName and Email?.
Charlie :)
Hi Charlie,
thanks for replying me. Your first sentence is the case: if you call Member.GetCurrentMember() after the save action, we got member null... :(
Hi Emiliano did you solve this?
sorry been busy and did not get a notification :(
Charlie
What is the member id you are passing in?
Charlie
Hi Charles,
sorry I have been on holidays. my collegue have solved the issue... actually it was our fault because we were trying to do that by ajax calls. Now forcing the redirect to a new request, it works fine.
so that the library works fine :D
Many thanks,
Emiliano
Hi Emiliano,
Glad you got it fixed :).
Charlie
is working on a reply...