code_junkie

C# asp.net custom MembershipUser.createUser() method, call it from createuserwizard control

Nov 13th, 2011
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. // Create an empty Profile for the newly created user
  2. ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);
  3.  
  4. // Populate some Profile properties off of the create user wizard
  5. p.CurrentLevel = Int32.Parse(((DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("clevel")).SelectedValue);
  6.  
  7. // Save profile - must be done since we explicitly created it
  8. p.Save();
  9.  
  10. public void UpdateCurrentLvl_OnDeactivate(object sender, EventArgs e)
  11. {
  12. int level = Int32.Parse(((DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("clevel")).SelectedValue);
  13. MyMembershipUser myUser = (MyMembershipUser)Membership.GetUser(CreateUserWizard1.UserName);
  14. myUser.CurrentLVL = level;
  15. Membership.UpdateUser(myUser);
  16. }
Add Comment
Please, Sign In to add comment