AjaxControlToolkit.ModalPopupExtender 不工作
AjaxControlToolkit.ModalPopupExtender not working
我正在开发 asp.net 项目,
我添加了 AjaxControlToolkit,但总是出现错误。弹出窗口不工作,
<asp:ModalPopupExtender ID="mpConfirm" runat="server" CancelControlID="btnDeleteCancel" DropShadow="true"
TargetControlID="HiddenField1" PopupControlID="DivConfirm">
</asp:ModalPopupExtender>
<asp:HiddenField ID="HiddenField1" runat="server" />
<div class="panel" runat="server" id="DivConfirm">
<div class="panel-body" style="">
<asp:GridView ID="gvHelp" runat="server" AllowPaging="True" CssClass="table table-bordered table-condensed table-hover" PageSize="5" OnRowCommand="gvHelp_RowCommand" CellPadding="4" ForeColor="#333333" GridLines="None">
<%--<AlternatingRowStyle BackColor="Silver" />--%>
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True">
<%--<ItemStyle ForeColor="#004080" />--%>
</asp:CommandField>
</Columns>
<%--<HeaderStyle BackColor="#004080" ForeColor="White" />
<RowStyle ForeColor="Black" />--%>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<br />
<div>
<div>
<div>
<asp:Button ID="btnDeleteCancel" Width="55px" Height="25px" runat="server" Text="Cancel" Font-Size="Smaller" CssClass="btn btn-danger btn-xs" />
</div>
</div>
</div>
</div>
</div>
</div>
根据设计,AjaxControl-ModalPopup 必须以设计用于扩展的控件为目标。无法扩展隐藏字段,因为模态控件是为使用不同的控件列表而构建的;文本框、按钮等
这里是 link 来自 ajax 控制工具包的源代码,
http://www.asp.net/web-forms/overview/ajax-control-toolkit/modalpopup/launching-a-modal-popup-window-from-server-code-cs
在我更改 Ajax 工具包版本 15.1.4
后,我终于找到了我目前使用的解决方案 16.1.1
,现在可以使用
我正在开发 asp.net 项目, 我添加了 AjaxControlToolkit,但总是出现错误。弹出窗口不工作,
<asp:ModalPopupExtender ID="mpConfirm" runat="server" CancelControlID="btnDeleteCancel" DropShadow="true"
TargetControlID="HiddenField1" PopupControlID="DivConfirm">
</asp:ModalPopupExtender>
<asp:HiddenField ID="HiddenField1" runat="server" />
<div class="panel" runat="server" id="DivConfirm">
<div class="panel-body" style="">
<asp:GridView ID="gvHelp" runat="server" AllowPaging="True" CssClass="table table-bordered table-condensed table-hover" PageSize="5" OnRowCommand="gvHelp_RowCommand" CellPadding="4" ForeColor="#333333" GridLines="None">
<%--<AlternatingRowStyle BackColor="Silver" />--%>
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True">
<%--<ItemStyle ForeColor="#004080" />--%>
</asp:CommandField>
</Columns>
<%--<HeaderStyle BackColor="#004080" ForeColor="White" />
<RowStyle ForeColor="Black" />--%>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<br />
<div>
<div>
<div>
<asp:Button ID="btnDeleteCancel" Width="55px" Height="25px" runat="server" Text="Cancel" Font-Size="Smaller" CssClass="btn btn-danger btn-xs" />
</div>
</div>
</div>
</div>
</div>
</div>
根据设计,AjaxControl-ModalPopup 必须以设计用于扩展的控件为目标。无法扩展隐藏字段,因为模态控件是为使用不同的控件列表而构建的;文本框、按钮等
这里是 link 来自 ajax 控制工具包的源代码, http://www.asp.net/web-forms/overview/ajax-control-toolkit/modalpopup/launching-a-modal-popup-window-from-server-code-cs
在我更改 Ajax 工具包版本 15.1.4
后,我终于找到了我目前使用的解决方案 16.1.1
,现在可以使用