ASP.NET Ajax 模式弹出扩展器在自定义用户控件中显示问题
目前我有一个自定义用户控件,其中有一个小表单和一个模式弹出扩展程序,其想法是让用户控件在父页面中动态加载并显示,以便用户可以填写表单并提交它和所有内容在用户控件上处理提交代码
我遇到的问题是当尝试使模式弹出窗口显示以便用户可以与其交互时,根本没有显示任何内容,代码如下:
用户控件:
<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;" />
父页面中的代码:
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();
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();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此页面可能会有所帮助你。本质上,它创建一个普通面板并将 updatePanel 放置在其中。然后,普通面板将用作 Extender 的 PopupControlID 属性。
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.