简体   繁体   中英

ASP.NET Ajax modal popup extender within a custom user control display issues

Currently I have a custom user control and within it is a little form and a modal popup extender, the idea is for the user control to be loaded dynamically in the parent page and displayed so the user can fill out the form and submit it and all the submission code be handled on the user control

the problem I am having is when trying to make the modal popup display so the user can interact with it, nothing is being displayed at all, code follows:

the user control:

<asp:UpdatePanel ID="breakTheGlassUpdatePanel" runat="server">
<ContentTemplate>
    //some fields for entry and a submit/cancel button
</ContentTemplate>
</asp:UpdatePanel>

<ajaxToolkit:ModalPopupExtender runat="server" ID="breakModal"
    TargetControlID="breakModalHolder" 
    BackgroundCssClass="btgModalBackground" 
    DropShadow="true" 
    PopupControlID="breakTheGlassUpdatePanel" />

    <asp:Button ID="breakModalHolder" runat="server" Style="display:none;" />

Code in parent page:

BreakTheGlassControl btgControl = (BreakTheGlassControl)Page.LoadControl("~/ARISUserControls/BreakTheGlassControl.ascx");
AjaxControlToolkit.ModalPopupExtender breakModal = (AjaxControlToolkit.ModalPopupExtender)btgControl.FindControl("breakModal");
breakTheGlassPanel.Controls.Add(btgControl);//panel in parent page
breakTheGlassPanel.Visible = true;
breakTheGlassPanel.Controls.Add(btgControl);
breakModal.Show();

This page might help you. Essentially, it creates a normal panel and places the updatePanel inside it. The normal panel is then used as the Extender's PopupControlID attribute.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM