Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Error in CreateUserWizard

Reply
Thread Tools

Error in CreateUserWizard

 
 
skiabox skiabox is offline
Junior Member
Join Date: Nov 2008
Posts: 3
 
      12-02-2008
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change CreateUserWizard error message color AAaron123 ASP .Net 6 10-22-2008 01:43 PM
Add an error message to CreateUserWizard for duplicate username ibiza ASP .Net 3 08-14-2007 04:50 PM
CreateUserWizard customization error messages pgaudreau@bnkadvisorygroup.com ASP .Net 0 08-10-2007 09:18 PM
how to change rule and text of password error in CreateUserWizard? Dan ASP .Net Web Controls 0 02-08-2007 09:33 AM
CreateUserWizard control error Kha Tran ASP .Net 3 06-08-2005 11:40 PM



Advertisments