CreateUserWizard - how clean up data before accepted?

V

VB Programmer

I am using the CreateUserWizard. In there I have "Username" and some other
fields (stored in profile). For a few of the fields I want to "clean up"
the data before the data is saved. (Remove the spaces, remove special
characters, etc...) How can I do this? Do I use the "_CreatingUser" event?
If so, how do I refer to the individual controls in the CreateUserWizard?

Thanks!
 
C

chris

You are on the right track.

You capture the CreatingUser event and write your code in there.

Here is a C# example:
void CUW1_CreatingUser(object sender, LoginCancelEventArgs e)
{
bool isValid = false;

string username =
((TextBox)CUW1.CreateUserStep.ContentTemplateContainer.FindControl("UserName")).Text;


if (!isValid)
e.Cancel = true;
}

You can then test whichever controls you wish and then cancel the user
creation if everything is not up to snuff.

HTH,
Chris
 

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,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top