gpt4 book ai didi

javascript - 当与 OnServerClick ASP.net 一起使用时,Bootstrap 模式在按钮单击时关闭

转载 作者:太空宇宙 更新时间:2023-11-03 15:16:01 25 4
gpt4 key购买 nike

我们要求在我们的 asp.net 应用程序中使用 bootstrap.css,我们遇到了模态问题,当我们点击搜索时模态关闭按钮。

下面是放置在 id 为“modal1”的模态下方的按钮

 <button  type="button" class="btn btn-primary" onserverclick="searchData">
search
</button>

一个可能的解决方案,可能是我可以在控件返回时执行 $("#modal1").modal()。但是有了这个解决方案,我的模式就会刷新,每次我点击搜索按钮时都会闪烁。

任何人都可以帮助我如何刷新模态数据。

最佳答案

您必须使用 Ajax 概念。希望对您有所帮助。

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Button ID="btnShow" runat="server" Text="Show Modal Popup" />

<!-- ModalPopupExtender -->
<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="btnShow" CancelControlID="btnClose" ackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" align="center" style = "display:none">
This is an ASP.Net AJAX ModalPopupExtender Example<br />
<asp:Button ID="btnClose" runat="server" Text="Close" />
</asp:Panel>
<!-- ModalPopupExtender -->
</form>

关于javascript - 当与 OnServerClick ASP.net 一起使用时,Bootstrap 模式在按钮单击时关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39073623/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com