Link to home
Start Free TrialLog in
Avatar of razzzzer
razzzzer

asked on

CreatingUser problem ... createuserwizard updating one field with another

howdy experts...

i am using the createuserwizard for a register page but have a small problem.  I want the userid to be an email address so i renamed the label for the username to email but left the id field as userid.  I then made the email field visible = false.

i want to call the CreatingUser method to set the email field to the username field before it processes but this doesnt seem to be happening as I look into the database and the user is created but the email for that user is blank.

ive tried to set it this way here plus tried using just CreateUserWizard1.Email =

right above this code i have a
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)

call that works just fine


protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
    {
        CreateUserWizard cuw = (CreateUserWizard)sender;
        cuw.Email = cuw.UserName;
    }

Open in new window

Avatar of JimBrandley
JimBrandley
Flag of United States of America image

Try changing it to this:
protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
    {
        Createuserwizard1.Email = Createuserwizard1.UserName;
    }

Jim
Avatar of razzzzer
razzzzer

ASKER

that still doenst work... the email column in database is still empty... (
That doesn't make sense. Try this to see if we can learn anything:
protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
    {
        string name = Createuserwizard1.UserName;
        string startEmail = Createuserwizard1.Email;
        Createuserwizard1.Email = Createuserwizard1.UserName;
        string endEmail = Createuserwizard1.Email;

    }

Set a breakpoint in there to see what the results are.

Jim
i know it doesnt make sense )

the function right above it (created) works fine...
hmm if i did this correctly the breakpoints never halted the code so this function isnt being called.... do i have to tell the wizard to call it?  was under the impression that it would do so automatically....
Is this a delegate, or have you created a custom UserWizard class?

If it's a custom class, you would need to add:
base.CreatingUser( sender, e);

Otherwise, I'm out of ideas.

Jim
ASKER CERTIFIED SOLUTION
Avatar of JimBrandley
JimBrandley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
my bad... didnt have the oncreatinguser= set....

thanks!
Good! Glad that's fixed.

Jim