I was wondering if somone could help me with this error that I'm getting. It's No member with username 'xxxxxxx' exists.
I'm wanting to create a new member and save them, so I would expect
that the provider would return this message given that I want all
usernames to be unique.
How can I get this status as a message and then process the new member accordingly or am I just doing it completely wrong.
Thanks in advance.
Sean
//member class public static MemberProfile GetUserProfile() { return Create(Membership.GetUser().UserName) as MemberProfile; }
//snippet from the OnCreatingUser event myproject.Members.MemberProfile mp = myproject.Members.MemberProfile.GetUserProfile(strUserName); if (mp != null) { mp.AuthGuid = newUserGuid;
mp.secretQuestion =
((DropDownList)cuw.CreateUserStep.ContentTemplateContainer.FindControl("Question")).Text; mp.secretAnswer = ((TextBox)cuw.CreateUserStep.ContentTemplateContainer.FindControl("Answer")).Text; mp.isLocked = true; mp.isApproved = false; mp.Save();
No member with username 'xxxxxxx' exists
Hi There,
I was wondering if somone could help me with this error that I'm getting. It's No member with username 'xxxxxxx' exists.
I'm wanting to create a new member and save them, so I would expect that the provider would return this message given that I want all usernames to be unique.
How can I get this status as a message and then process the new member accordingly or am I just doing it completely wrong.
Thanks in advance.
Sean
//member class
public static MemberProfile GetUserProfile()
{
return Create(Membership.GetUser().UserName) as MemberProfile;
}
//snippet from the OnCreatingUser event
myproject.Members.MemberProfile mp = myproject.Members.MemberProfile.GetUserProfile(strUserName);
if (mp != null)
{
mp.AuthGuid = newUserGuid;
mp.secretQuestion = ((DropDownList)cuw.CreateUserStep.ContentTemplateContainer.FindControl("Question")).Text;
mp.secretAnswer = ((TextBox)cuw.CreateUserStep.ContentTemplateContainer.FindControl("Answer")).Text;
mp.isLocked = true;
mp.isApproved = false;
mp.Save();
Roles.AddUserToRole(strUserName, "Retail");
Hi,
You need to change the following line and use the string value. Now you are submitting an empty value
Create(Membership.GetUser().UserName)
Cheers,
Richard
Hi Richard,
I'm not sure what I'm doing wrong here. I'm passing the username value and it's still giving me the same error. Any other things I need to look at?
I changed this:
public static MemberProfile GetUserProfile()
{
return Create(Membership.GetUser().UserName) as MemberProfile;
}
to this:
public static MemberProfile GetUserProfile(string username)
{
return Create(username) as MemberProfile;
}
Hello?
is working on a reply...