Error in CreateUserWizard

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

Code:
hxxp://w w w.shorttext.com/98jce9p

The code behind is

Code:
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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top