Error in CreateUserWizard

Discussion in '.NET' started by skiabox, Dec 2, 2008.

  1. skiabox

    skiabox

    Joined:
    Nov 26, 2008
    Messages:
    2
    Likes Received:
    0
    I tried this one but I get an error :

    Code (Text):

    hxxp://w w w.shorttext.com/98jce9p
     
    The code behind is

    Code (Text):

    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        {
            Roles.AddUserToRole(CreateUserWizard1.UserName, "Role1");

            TextBox UserNameTextBox = (TextBox)CreateUserWizardStep1.ContentTemplateContainer.FindControl("UserName");
            SqlDataSource DataSource = (SqlDataSource)CreateUserWizardStep1.ContentTemplateContainer.FindControl("InsertExtraInfo");

            MembershipUser User = Membership.GetUser(UserNameTextBox.Text);
            object UserGUID = User.ProviderUserKey;

            DataSource.InsertParameters.Add("ΚΩΔΙΚΟΣ_ΔΙΑΧΕΙΡΗΣΤΗ", UserGUID.ToString());
            DataSource.Insert();
        }
     
    And the error I get is :

    Object reference not set to an instance of an object.

    Source Error:

    Line 29: object UserGUID = User.ProviderUserKey;
    Line 30:
    Line 31: DataSource.InsertParameters.Add("ΚΩΔΙΚΟΣ_ΔΙΑΧΕΙΡΗΣΤΗ", UserGUID.ToString());
    Line 32: DataSource.Insert();
    Line 33: }

    Any help?
    Thanx!
     
    skiabox, Dec 2, 2008
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lloyd Dupont

    [2.0] asp:CreateUserWizard & confirmation?

    Lloyd Dupont, Oct 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    425
    Lloyd Dupont
    Oct 20, 2004
  2. Lloyd Dupont

    [2.0] CreateUserWizard

    Lloyd Dupont, Nov 1, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    467
    Lloyd Dupont
    Nov 1, 2004
  3. Lloyd Dupont

    [newbie & 2.0] ASP:CreateUserWizard

    Lloyd Dupont, Nov 8, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    507
    Lloyd Dupont
    Nov 8, 2004
  4. Kha Tran

    CreateUserWizard control error

    Kha Tran, Jun 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    627
    Brock Allen
    Jun 9, 2005
  5. ibiza
    Replies:
    3
    Views:
    8,807
    PhantomCoder
    Aug 14, 2007
  6. pgaudreau@bnkadvisorygroup.com

    CreateUserWizard customization error messages

    pgaudreau@bnkadvisorygroup.com, Aug 10, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    519
    pgaudreau@bnkadvisorygroup.com
    Aug 10, 2007
  7. AAaron123
    Replies:
    6
    Views:
    583
    AAaron123
    Oct 22, 2008
  8. Dan
    Replies:
    0
    Views:
    289
Loading...