gpt4 book ai didi

c# - 避免模​​式弹出窗口在回发时关闭

转载 作者:行者123 更新时间:2023-12-03 03:22:40 25 4
gpt4 key购买 nike

我在页面内弹出了一个引导模式。它里面有三个下拉菜单。其中两个将根据前一个下拉列表中选择的值进行填充。问题是弹出窗口在回发时关闭。有没有办法阻止这个弹出窗口关闭?

这是模态的设计。

<div class="modal fade" id="myModal" role="dialog"  margin-left: "150px;">
<div class="modal-dialog" style="width:440px">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel1">
<asp:Label runat="server" CssClass="col-md-2 control-label" ID="Label1" Font-Bold="True" Style="width: 200px" Font-Size="Medium"> Add Drug</asp:Label>
</h4>
</div>
<!-- Modal Body -->
<div class="modal-body" style="padding-left: 30px">
<div class="alert alert-danger fade in" role="alert" id="divError" runat="server" visible="false">
<a class="close" data-dismiss="alert" aria-label="close">&times;</a>
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</div>
<div class="alert alert-success fade in" role="alert" id="divSuccess" runat="server" visible="false">
<a class="close" data-dismiss="alert" aria-label="close">&times;</a>
<asp:Label ID="lblSuccess" runat="server" Text=""></asp:Label>
</div>


<div class="form-group row" style="height: 40px">
<asp:Label runat="server" CssClass="col-md-2 control-label" Font-Bold="True" Width="120px">Drug Class:</asp:Label>
<div class="col-md-4">
<asp:DropDownList ID="ddlClass" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlClass_SelectedIndexChanged" Width="200px">
</asp:DropDownList>
</div>

</div>
<div class="form-group row" style="height: 40px">
<asp:Label runat="server" CssClass="col-md-2 control-label" Font-Bold="True" Width="120px">Drug Name:</asp:Label>
<div class="col-md-4">
<asp:DropDownList ID="ddlName" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlName_SelectedIndexChanged" Width="200px"></asp:DropDownList>
</div>
</div>

<div class="form-group row" style="height: 40px">
<asp:Label runat="server" CssClass="col-md-2 control-label" Font-Bold="True" Width="120px">Brand Name:</asp:Label>
<div class="col-md-4">
<asp:DropDownList ID="ddlBrand" runat="server" Width="200px"></asp:DropDownList>

</div>
</div>
<div class="form-group row " style="height: 40px">
<asp:Label runat="server" CssClass="col-md-2 control-label" Font-Bold="True" Width="120px">Dose:</asp:Label>
<div class="col-md-2" >
<asp:TextBox ID="txtAmount" runat="server" Width="68px" CssClass="form-control" ></asp:TextBox>

</div>
<div class="col-md-2">
<asp:DropDownList ID="ddlDose" runat="server" CssClass="form-control" Width="70px" >
<asp:ListItem>mg</asp:ListItem>
<asp:ListItem>g</asp:ListItem>
<asp:ListItem>ml</asp:ListItem>
<asp:ListItem>tsp</asp:ListItem>
<asp:ListItem>tab</asp:ListItem>
</asp:DropDownList> </div>
</div>
<div class="form-group row" style="height: 40px">
<asp:Label runat="server" CssClass="col-md-2 control-label" Font-Bold="True" Width="120px">Frequency:</asp:Label>
<div class="col-md-4">
<asp:DropDownList ID="ddlFreaquency" runat="server" CssClass="form-control" >
<asp:ListItem>tds</asp:ListItem>
<asp:ListItem>bf</asp:ListItem>
<asp:ListItem>nocte</asp:ListItem>
<asp:ListItem>vesper</asp:ListItem>
<asp:ListItem>daily</asp:ListItem>
<asp:ListItem>weekly</asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="form-group row" style="height: 40px">
<asp:Label runat="server" CssClass="col-md-2 control-label" Font-Bold="True" Width="120px">Duration:</asp:Label>
<div class="col-md-4">
<asp:DropDownList ID="ddlDuration" runat="server" CssClass="form-control" ></asp:DropDownList>
</div>
</div>
<div class="modal-footer">
<asp:Button runat="server" Text="Save" CssClass="btn btn-primary" ID="Button1" OnClick="btnsave_Click" />
<button type="button" class="btn btn-default"
>
Close</button>
</div>
</div>
<div>
</div>

</div>
</div>
</div>

最佳答案

可以在回发过程中调用show()方法来阻止模态弹出窗口关闭

$("#myModal").modal('show');

关于c# - 避免模​​式弹出窗口在回发时关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39263647/

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