protected override void RenderContents(HtmlTextWriter writer) { if (Extender.AdapterEnabled) { CreateUserWizard wizard = Control as CreateUserWizard; if (wizard != null) { TemplatedWizardStep activeStep = wizard.ActiveStep as TemplatedWizardStep; if (activeStep != null) { if (activeStep.ContentTemplate != null) { activeStep.RenderControl(writer); if (wizard.CreateUserStep.Equals(activeStep)) { WriteCreateUserButtonPanel(writer, wizard); } // Might need to add logic here to render nav buttons for other kinds of // steps (besides the CreateUser step, which we handle above). } else if (wizard.CreateUserStep.Equals(activeStep)) { WriteHeaderTextPanel(writer, wizard); WriteStepTitlePanel(writer, wizard); WriteInstructionPanel(writer, wizard); WriteHelpPanel(writer, wizard); WriteUserPanel(writer, wizard); WritePasswordPanel(writer, wizard); WritePasswordHintPanel(writer, wizard); //hbb WriteConfirmPasswordPanel(writer, wizard); WriteEmailPanel(writer, wizard); WriteQuestionPanel(writer, wizard); WriteAnswerPanel(writer, wizard); WriteFinalValidators(writer, wizard); if (_state == State.Failed) { WriteFailurePanel(writer, wizard); } WriteCreateUserButtonPanel(writer, wizard); } else if (wizard.CompleteStep.Equals(activeStep)) { WriteStepTitlePanel(writer, wizard); WriteSuccessTextPanel(writer, wizard); WriteContinuePanel(writer, wizard); WriteEditProfilePanel(writer, wizard); } else { System.Diagnostics.Debug.Fail("The adapter isn't equipped to handle a CreateUserWizard with a step that is neither templated nor either the CreateUser step or the Complete step."); } } } } else { base.RenderContents(writer); } }
/// <summary> /// Handles the Click event of the StartNextButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void StartNextButton_Click(object sender, EventArgs e) { if (this.IsValid) { TemplatedWizardStep step = (TemplatedWizardStep)wizard.WizardSteps[0]; UserWeb.Controls.Company.CompanyDetails companyDetails = (UserWeb.Controls.Company.CompanyDetails)step.ContentTemplateContainer.FindControl("ucCompanyDetails"); Data.Company company = companyDetails.SaveCompanyDetails(false, false); paymentValidation.NewCompany = company; UserWeb.Controls.Company.CompanyHeaderDetails companyHeaderDetails = (UserWeb.Controls.Company.CompanyHeaderDetails)step.ContentTemplateContainer.FindControl("companyHeaderDetails"); paymentValidation.Media = companyHeaderDetails.GetMedia(); paymentPackageSummary.UpdatePaymentSummary(); lblTitle.Text = "Select Pricing Plans"; } }
/// <summary> /// We ovveride RenderContents so we output what we want (only what is inside the <ContentTemplate>) /// </summary> protected override void RenderContents(HtmlTextWriter writer) { TemplatedWizardStep activeStep = wizard.ActiveStep as TemplatedWizardStep; if (activeStep.ContentTemplate != null) { //-- Render what is inside the active step <ContentTemplate> RenderContainer(activeStep.ContentTemplateContainer.Controls[0], writer); if (activeStep.CustomNavigationTemplate != null) { //-- Render what is inside the active step <CustomNavigationTemplate> RenderContainer(activeStep.CustomNavigationTemplateContainer, writer); } } else { base.RenderContents(writer); } }
protected override void CreateChildControls() { base.CreateChildControls(); CreateUserWizard wizard = Control as CreateUserWizard; if (wizard != null) { TemplatedWizardStep activeStep = wizard.ActiveStep as TemplatedWizardStep; if (activeStep != null) { if ((activeStep.ContentTemplate != null) && (activeStep.Controls.Count == 1)) { Control container = activeStep.ContentTemplateContainer; if (container != null) { container.Controls.Clear(); activeStep.ContentTemplate.InstantiateIn(container); container.DataBind(); } } } } }
//------------------------------------------------------------------------------------------- private Control GetControlFromWizard(TemplatedWizardStep wzdTemplate, string controlName) { return(wzdTemplate.ContentTemplateContainer.FindControl(controlName)); }
private Control findControl(string id) { if (wizardStepTwo == null) wizardStepTwo = (TemplatedWizardStep)wizCreateUser.WizardSteps[1]; return wizardStepTwo.Controls[0].FindControl(id); }