1

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?

4

1 回答 1

0

这是我最终做到的方式:

  1. 引用 CreateWizard 按钮并分配给面板的默认按钮:

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

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

我无法使用上述内容,因为它给了我错误“'RegisterPanel' 的 DefaultButton 必须是 IButtonControl 类型的控件的 ID”

  1. 我最终创建了一个名为“RegisterButton”的虚拟按钮(与模板内的注册按钮同名)并使用 CSS 将其隐藏,并为其 OnClick 提供了“真实”注册按钮的函数调用。

  2. 对于登录部分,我使用了这个: Page.Form.DefaultButton = LoginButton.UniqueID

于 2009-06-29T18:16:26.353 回答