locked
ASPNET_MEMBERSHIP Problem RRS feed

  • Question

  • User1628746328 posted

    I have updated this project to allow a person to register on the Register.aspx in 2 scenarios.

    1. A basic membership registration

    2. A paid registration, which re-directs to paypal, where the user pays, and is redirected back to our classified app

     

    The first type of registration works fine, i beleive it is using this code:

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    protected void CreateUserWizardControl_CreatedUser(object sender, EventArgs e)

    {

    Response.Write(
    "CreateUserWizardControl_CreatedUser called <br>");

    string username = CreateUserWizardControl.UserName;

    ProfileCommon userProfile = Profile.GetProfile(CreateUserWizardControl.UserName);if (userProfile != null)

    {

    userProfile.MemberId = MembersDB.CreateMember(username, Membership.ApplicationName);

    userProfile.FirstName = (Util.FindControlRecursively("FirstName", CreateUserWizardControl.Controls) as TextBox).Text;userProfile.LastName = (Util.FindControlRecursively("LastName", CreateUserWizardControl.Controls) as TextBox).Text;

    userProfile.MembershipType = 1;

    userProfile.Save();

    }

    }

    And is populating all of the tables needed for a registration which *I think* are these 5 tables

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 

    a) aspnet_membership

    b). aspnet_profile

    c). aspnet_users

    d). aspnet_UsersInRoles

    e). members

     

    For some reason,  in the PayPal Registration registration, all of the tables:

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 

     b). aspnet_profile

    c). aspnet_users

    d). aspnet_UsersInRoles

    e). members

    EXCEPT:

    a) aspnet_membership 

     Are getting populated, and I cannot determine why.

    I've verified that the code is getting called on the redirection back from PayPal, and it seems to be virtually identical

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 

    CreateUserWizardControl.UserName = Session[
    "UserName"].ToString();

    (Util.FindControlRecursively("FirstName", CreateUserWizardControl.Controls) as TextBox).Text = Session["FirstName"].ToString();

    (Util.FindControlRecursively("LastName", CreateUserWizardControl.Controls) as TextBox).Text = Session["LastName"].ToString();

    (Util.FindControlRecursively("ddMembershipType", CreateUserWizardControl.Controls) as DropDownList).SelectedValue = Session["MembershipType"].ToString();

    string username = Session["UserName"].ToString();

    ProfileCommon userProfile = Profile.GetProfile(username);

    if (userProfile != null)

    {

    userProfile.MemberId = MembersDB.CreateMember(username, Membership.ApplicationName);

    userProfile.FirstName = (Util.FindControlRecursively("FirstName", CreateUserWizardControl.Controls) as TextBox).Text;

    userProfile.LastName = (Util.FindControlRecursively("LastName", CreateUserWizardControl.Controls) as TextBox).Text;

    userProfile.MembershipType = 2;//int.Parse((Util.FindControlRecursively("ddMembershipType", CreateUserWizardControl.Controls) as DropDownList).SelectedValue.ToString());

    userProfile.Save();

    //Response.Write("<br>" + CreateUserWizardControl.ActiveStepIndex.ToString());

    //CreateUserWizardControl.ActiveStepIndex = 1;

     

    }

    else

    {

    Response.Write(
    "USER PROFILE is NULL");Response.Write("<br>" + CreateUserWizardControl.ActiveStepIndex.ToString());

    }

    }

    Perhaps a fresh set of eyes can see where I'm failing.

     

    thanks.

     

    doug.,

    Monday, September 29, 2008 6:21 PM

All replies

  • User546723956 posted

     if you examine aspnet_membership table you can see columns related with user password and other columns related for the user last logon time and other datas ( http://msdn.microsoft.com/en-us/library/aa478948.aspx). here in you code i can see nothing related with that table atleast the password! you are not sending any datarelated with that table .

    check the createuser method of the membership here http://msdn.microsoft.com/en-us/library/system.web.security.membership.createuser.aspx.

    hope this helps

    notice : in your code MembersDB.CreateMember(username, Membership.ApplicationName) here you can not override createmembership method wit huser name and application name. usernamse and password is the right way to do that http://msdn.microsoft.com/en-us/library/d8t4h2es.aspx

    Monday, September 29, 2008 6:49 PM
  • User1628746328 posted

    thanks for your reply Muhanad

    CreateMember is a method of a sealed class called MembersDB which was included in the Classifieds Application.

     So I don't think that's the problem, since:

    1. It's working for the Basic Membership Registration

    2. The application compiles and doesn't complain about the parameters in

    MembersDB.CreateMember(username, Membership.ApplicationName);

    So, all of that said...I guess I'm still stuck...

     doug..

     

    Tuesday, September 30, 2008 7:09 AM
  • User1628746328 posted

    I'm still having a problem getting this to work...

     anyone?

    Saturday, October 4, 2008 8:57 AM