Programmatically Assigning CreateUserStep.ContentTemplate

T

terry.aney

I am building a compiled control (so that a dll can simply be
referenced) to build our CreateUser control. Since I am in a library
dll, I can't use HTML to generate markup for the template. I've got
code in *my control* to do the following:

CreateUserWizard register = new CreateUserWizard();
register.RequireEmail = false;
register.CreatedUser += new EventHandler( register_CreatedUser );
register.CreateUserError += new
CreateUserErrorEventHandler( register_CreateUserError );
register.CreatingUser += new
LoginCancelEventHandler( register_CreatingUser );
register.CreateUserStep.ContentTemplate = new
CompiledTemplateBuilder( new
BuildTemplateMethod( register_CreateUserStep_ContentTemplate ) );
view.Controls.Add( register ); // A view in a MultiView control

void register_CreateUserStep_ContentTemplate( Control container )
{
// Several container.Controls.Add() member calls
}

Unfortunately, my BuildTemplateMethod never gets called. Is it not
possible to generate a CreateUserWizard UI from compiled code?

Note that the following for a Login control worked fine:

Login login = new Login();
login.LoggedIn += new EventHandler( login_LoggedIn );
login.LoginError += new EventHandler( login_LoginError );
login.LoggingIn += new LoginCancelEventHandler( login_LoggingIn );
login.LayoutTemplate = new CompiledTemplateBuilder( new
BuildTemplateMethod( login_LayoutTemplate ) );
view.Controls.Add( login );

Thanks in advance.
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top