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

razzzzerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Jim
0
razzzzerAuthor Commented:
that still doenst work... the email column in database is still empty... (
0
JimBrandleyCommented:
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
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

razzzzerAuthor Commented:
i know it doesnt make sense )

the function right above it (created) works fine...
0
razzzzerAuthor Commented:
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....
0
JimBrandleyCommented:
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
0
JimBrandleyCommented:
Aha! You need to add a delegate if this isn't a custom class.

Jim
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
razzzzerAuthor Commented:
my bad... didnt have the oncreatinguser= set....

thanks!
0
JimBrandleyCommented:
Good! Glad that's fixed.

Jim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.