Bootstrap模态隐藏后冻结页面

时间:2019-04-28 17:17:55

标签: javascript asp.net web webforms bootstrap-4

我在页面上有一个按钮可以打开模式:

<button data-toggle="modal" data-target="#connProductsModal" type="button" class="btn btn-brand"><%= GetGlobalResourceObject("ButtonText", "BTN_EDIT_PRODUCTS") %></button>

这将以以下方式打开:

<div class="modal fade" id="connProductsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Details</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <asp:UpdatePanel runat="server" ID="udpEditConnProd">
                    <ContentTemplate>
                        <telerik:RadGrid ID="gvEditConnectedProducts" runat="server" AllowMultiRowSelection="True" RenderMode="Lightweight" Skin="Material" PageSize="25" BorderWidth="0" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="False">
                            <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnableRowHoverStyle="True">
                            </ClientSettings>
                            <MasterTableView DataKeyNames="ProductId">
                                <Columns>
                                    <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                                        <HeaderStyle CssClass="myGridHeader" />
                                        <ItemTemplate>
                                            <label class="k-checkbox k-checkbox--brand">
                                                <asp:CheckBox runat="server" ID="cbSelectedItem" AutoPostBack="True" OnCheckedChanged="ToggleRowSelection" />
                                                <span></span>
                                            </label>
                                        </ItemTemplate>
                                        <HeaderTemplate>
                                            <label class="k-checkbox k-checkbox--brand">
                                                <asp:CheckBox runat="server" ID="headerCheckbox" AutoPostBack="True" OnCheckedChanged="ToggleSelectedState" />
                                                <span></span>
                                            </label>
                                        </HeaderTemplate>
                                        <ItemStyle Width="25px" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="ProductCode" HeaderText="<%$ resources: PRODUCT_GRID_CODE %>" UniqueName="Address" Visible="True">
                                        <HeaderStyle CssClass="myGridHeader" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ProductName" HeaderText="<%$ resources: PRODUCT_GRID_NAME %>" UniqueName="first_name" Visible="True">
                                        <HeaderStyle CssClass="myGridHeader" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ProductNumber" HeaderText="<%$ resources: PRODUCT_GRID_NUMBER %>" UniqueName="Address" Visible="True">
                                        <HeaderStyle CssClass="myGridHeader" />
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <asp:LinkButton runat="server" ID="btnAddSelectedProducts" OnClick="btnAddSelectedProducts_OnClick" class="btn btn-brand"><%= GetGlobalResourceObject("ButtonText", "BTN_UPDATE") %></asp:LinkButton>
            </div>

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

当我在模式下按“保存”时,应使用条件更新模式更新更新面板中的研磨。触发是模态中的保存按钮。

这有效...但是方法完成后,模态不会关闭..我在后面的代码中使用它来“隐藏”模态,巫婆作品。

 ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "$('#connProductsModal').modal('hide');", true);

但是该页面(所有Java脚本功能)冻结了:/如果我跳过“隐藏”功能,一切都会正常进行,但模式不会关闭。

有什么主意吗?

0 个答案:

没有答案