【发布时间】:2010-02-03 02:45:16
【问题描述】:
我正在使用 AJAX 工具包中的 ModalPopupExtender 控件。此控件扩展了包含 CreateUserWizard 控件的面板。但是,CreateUserWizard 控件的验证会导致回发到服务器,从而关闭弹出窗口。我希望弹出窗口保持打开状态,即使在回发之后也是如此。据我所知,我应该使用 UpdatePanel。但是,我似乎无法让它工作。它非常棘手的原因是结构应该是:
ModalPopupExtender
<Panel>
<UpdatePanel>
<ContentTemplate>...</ContentTemplate>
</UpdatePanel>
</Panel>
我无法遵循这种结构,因为ModalPopupExtender 依赖于包含在 CreateUserWizard 控件中的按钮。因此,必须将其添加到<asp:CreateUserWizard> </asp:CreateUserWizard> 标记中。我希望 CreateUserWizard 控件中内置的提交按钮强制更新面板。关于结构应该如何的任何建议?我的代码是高度定制的,所以它很长。但是,关键结构是这样的:
<asp:Panel>
<asp:CreateUserWizard>
<WizardSteps>
<asp:CreateUserWizardStep>
<ContentTemplate>
//Form Controls here
</ContentTemplate>
<CustomNavigationTemplate>
//The SUBMIT button that should force update
//CANCEL button
<asp:ModalPopupExtender /> //References the CANCEL button therefore has to be here
</CustomNavigationTemplate>
</asp:CreateUserWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
</asp:Panel>
UpdatePanel 应该放在哪里?或者有没有更有效的方法来确保 ModalPopup 不会关闭?
感谢您的帮助
【问题讨论】:
标签: asp.net ajax postback modalpopupextender createuserwizard