试图自我含有使用AjaxToolkit ModalPopUpExtender弹出窗口 [英] Trying to self contain pop ups which use the AjaxToolkit ModalPopUpExtender

查看:354
本文介绍了试图自我含有使用AjaxToolkit ModalPopUpExtender弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个不同的需要跨我的网站存在AJAX弹出窗口。我希望我可以简单地创建为每一个用户的控制,并把每一个内部的面板和模态弹出扩展,但这似乎并不奏效。有没有人尝试这之前或者你有一个建议,我怎么能避免重复code语言为每个不同的页面上弹出?谢谢!

I have 3 different kinds of ajax popups that need to exist across my site. I was hoping that I could simply create a user control for each one and place the panel and modal popup extender inside each one but this doesn't seem to be working. Has anyone tried this before or do you have a recommendation as to how I can avoid duplicate code for each pop up on different pages? Thanks!

推荐答案

啊我想通了,我的问题与用户控制,我相信。

Ah I figured out my issue with the User Control I believe.

该ModalPopUpExtender需要出现错误时另行设定目标ID属性。由于这是坐在一个用户控件我刚刚创建了一个虚拟链接按钮,这并不做任何事情,我的财产可见设置为false。

The ModalPopUpExtender requires the TargetID property to be set otherwise an error occurs. Since this is sitting in a UserControl I just created a dummy link button that doesn't do anything and I set the property visible to false.

    <asp:LinkButton ID="lnkBlank" runat="server" Visible="false" />
    <asp:Panel ID="plContainer" style="display: none;" runat="server">
            Hello?
    </asp:Panel>
    <cc1:ModalPopupExtender ID="mpe" runat="server" 
            BehaviorID="test"
            TargetControlID="lnkBlank" 
            PopupControlID="plContainer" />

显然,这不AP preciate这一点,那一刻我的Visible属性设置为true,它开始工作。不知道的理由是什么样的目标ID,因为,我想,大多数弹出窗口可从有关页面的多个链接调用。也许我仍然在这个控制应该如何使用还不完全清楚。

Apparently it doesn't appreciate that and the moment I set the visible property to true it started working. Not sure what the reasoning is for a TargetID since, I would think, most pop ups could be called from multiple links about the page. Perhaps I'm still not entirely clear on how this control is supposed to be used.

这篇关于试图自我含有使用AjaxToolkit ModalPopUpExtender弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆