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 doind it 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();
Error creating a new user
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 doind it 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");
}
is working on a reply...