I am creating a .NET website, and this is my first time using a createuserwizard control.
I need to pre-fill the email address for users (the website is by invitation only) and disable it. However, the email field still needs to be required.
I have managed to edit the template and disable the email field, and fill it programatically in the .aspx.cs file. However, when I disable the email field and pre-fill it, the createuserwizard form will not submit. It treats the email field as if it were empty and always returns me to the create user page, with a red asterisk by the email field. This happens even if I set the RequireEmail property to False.
Is there a way to force users to register with a given email address? I had hoped the createuserwizard would make my life easier, but so far it hasn’t. Thanks.
I’ve done something like this – in my case I didn’t want a separate username, I used their email address as their username (and didn’t allow them to change it), so I did:
That’s all it took for me – if you don’t care about forcing the username, I’d recommend hooking up to the CreatingUser event and inspect the email Text property to make sure it’s set properly. Perhaps something else is clearing it after you’ve set it.
FWIW, in my codebehind I added a couple of properties to make it easier to access those textboxes, although there’s likely better ways of doing this 🙂