【问题标题】:ModalPopupExtender and dropdownlistModalPopupExtender 和下拉列表
【发布时间】:2013-05-30 14:48:18
【问题描述】:

我的页面上有以下代码:

    <asp:ModalPopupExtender ID="mpLabelCheck" PopupControlID="pnlModal" TargetControlID="lstCategory" 
OkControlID="btnOK" runat="server" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
<asp:Panel id="pnlModal" CssClass="modalPopup" runat="server">
    <p>Please make sure all data is entered before continuing.</p>
    <p><asp:Button ID="btnOK" Text="OK" runat="server" /></p>
</asp:Panel>

目标控件 ID 是一个下拉列表。发生的情况是与下拉列表的任何交互都会触发弹出窗口。我想等到用户做出选择,然后根据另一种方法的结果有条件地显示弹出窗口。

有什么想法可以做到这一点吗?

【问题讨论】:

  • then conditionally show the popup based on the result of another method. 什么类型的方法(服务器端或javascript函数)?
  • 我在考虑服务器端。我需要检查数据库中的记录,然后呈现(或不呈现)模式弹出窗口。

标签: asp.net asp.net-ajax ajaxcontroltoolkit


【解决方案1】:

使用虚拟隐藏控件作为扩展器的目标,并通过Show 方法调用将其显示在服务器代码中

【讨论】:

    猜你喜欢
    • 2012-05-04
    • 1970-01-01
    • 1970-01-01
    • 2017-06-22
    • 2012-09-29
    • 2014-12-06
    • 1970-01-01
    • 1970-01-01
    • 2016-03-16
    相关资源
    最近更新 更多