当我点击模态关闭按钮时,它会消失,但是当我点击背景时,它不仅会消失,还会禁用模态按钮以及页面上的所有链接。
可能的原因是什么?
Asp.net代码:
<asp:Button ID="Button3" runat="server" Text="Modal Popup" class="btn btn-primary btn-lg"
data-toggle="modal" data-target="#myModal" OnClick="Button3_onClick" />
<asp:ModalPopupExtender ID="ModalPopupExtender_Error" runat="server" TargetControlID="Button3"
PopupControlID="MyPanel_Error" Enabled="True" CancelControlID="CloseError_btn"
DynamicServicePath="">
</asp:ModalPopupExtender>
<asp:Panel ID="MyPanel_Error" runat="server">
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">
Grid View in popup panel</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GridView2" CssClass="table" runat="server" AutoGenerateColumns="False"
DataSourceID="LinqDataSource2">
<Columns>
<asp:BoundField DataField="COUNTRY_ID" HeaderText="Country ID" ReadOnly="True" SortExpression="COUNTRY_ID" />
<asp:BoundField DataField="COUNTRY1" HeaderText="Country" ReadOnly="True" SortExpression="COUNTRY1" />
</Columns>
</asp:GridView>
<asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="PerformanceAppraisalSystem.DataModel.PMSDataContext"
EntityTypeName="" OrderBy="COUNTRY1" Select="new (COUNTRY_ID, COUNTRY1)" TableName="COUNTRies"
Where="COUNTRY_ID < @COUNTRY_ID">
<WhereParameters>
<asp:Parameter DefaultValue="14" Name="COUNTRY_ID" Type="Int64" />
</WhereParameters>
</asp:LinqDataSource>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" id="CloseError_btn" class="btn btn-default" data-dismiss="modal">
Close</button>
<button type="button" class="btn btn-primary">
Save changes</button>
</div>
</div>
</div>
</div>
</asp:Panel>