我的模态中有一个列表框,在我关闭模态后没有清除。当我重新打开它时,数据仍然存在。 :(
这是我的代码:
的Javascript
$('#modalCRDDDST_Lookup').on('hidden.bs.modal', function (e) {
$("#modalCRDDDST_Lookup").remove();
});
我的模态代码
<div class="modal fade" id="modalCRDDDST_Lookup" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" style="width:800px;margin:5px auto">
<asp:UpdatePanel ID="upModalCRDDDST_Lookup" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content" style="height:650px">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><asp:Label ID="Label12" runat="server" Text="CRDDDST - Lookup"></asp:Label></h4>
</div>
<div class="modal-body">
<div class="form-group">
<asp:UpdatePanel ID="upCRDDDSTLookup" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnCRDDDSTLookup_Search" EventName="Click" />
</Triggers>
<ContentTemplate>
<table class="table">
<tr>
<td class="td col-md-12 bg-primary" style="text-align: center;">
<asp:Label ID="Label18" class="label" runat="server" Text="Results" Font-Size="Large"/>
</td>
</tr>
<tr>
<td>
<asp:ListBox ID="lbCRDDDSTLookup_Results" runat="server" Height="175px" Width="745px" SelectionMode="Multiple" ></asp:ListBox>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<div class="pull-right">
<asp:Button ID="btnCRDDDST_Lookup_Accept" runat="server" Text="OK" CssClass="btn btn-primary" OnClick="LookupCRDDDSTSearch" />
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
请有人帮我解决问题。
由于