views:

763

answers:

1

Hi,

I'm using a CreateUserWizard on my register page. The Sign Up button is part of a CustomNavigationTemplate.

I need to set the Sign Up button as the default button of a ASP:Panel, but can't do so since it's inside the template. I tried to do so, but I can't locate the Sign Up button using CreateUserWizard.FindControl, CreateUserWizard.WizardSteps(0).Controls(0).FindControl or other similar steps (this is a known issue with this control).

Any ideas on how I can expose this button, or set it as the panel's default button in some other way?

A: 

Here's how I finally did it:

  1. Referencing the CreateWizard Button and assigning to Panel's Default Button:

    Dim RegisterButton as Button = Ctype(CreateUserWizardStep1.CustomNavigationTemplateContainer.FindControl("RegisterButton"), Button)

RegisterPanel.DefaultButton = RegisterButton.ID 'Or RegisterButton.UniqueID

I wasn't able to use the above, because it was giving me the error "The DefaultButton of 'RegisterPanel' must be the ID of a control of type IButtonControl"

  1. I finally created a dummy button called "RegisterButton" (same name as the register button inside the template) and hid it using CSS, and gave it's OnClick the 'real' register button's function call.

  2. For the login section, I used this: Page.Form.DefaultButton = LoginButton.UniqueID

Wild Thing