簡體   English   中英

更新面板刷新后,控件不起作用

[英]Controls don't work after update panel refresh

我正在使用UpdatePanel內部的asp:Repeater構建表。 該表的列包含一些按鈕。 當按下這些按鈕時,UpdatePanel會有部分刷新(我認為..)。

奇怪的是,位於另一個UpdatePanel內部和頂部的其他OTHER按鈕停止工作。

如果我不單擊中繼器中的按鈕,它們將完美工作。 否則,他們似乎不再響應點擊事件。

澄清:刷新按鈕保持工作。 但是,即使是簡單的復選框也不再起作用。

這是代碼:

<div id="containerNotificationCenterDx">
                <!-- Contains the five buttons that stop working -->
                <div id="containerNotificationFilter">
                    <asp:UpdatePanel runat="server" ID="UpPnlBAction" UpdateMode="Conditional" ClientIDMode="static">
                        <ContentTemplate>
                            <div class="col11" style="padding-left: 10px">
                                <asp:CheckBox ID="cbSelectAllNotify" runat="server" CssClass="clickableRight" OnCheckedChanged="SelectAllNotify_CheckedChanged"
                                    AutoPostBack="true" />
                                <asp:LinkButton runat="server" ID="IndexImgRefreshCM" OnClick="IndexImgRefreshCM_OnClick" CssClass="clickableRight">
                                    <i class="fa fa-refresh"></i> <!-- this always works -->
                                </asp:LinkButton>                            
                                <asp:LinkButton runat="server" ID="IndexImgAddFilterCM" OnClientClick="return ajaxModalPopupAddFilterNotificationCenter();" CssClass="clickableRight">
                                    <span id="spanAddFilter">
                                        <i class="fa fa-filter"></i>
                                        <i class="fa fa-plus"></i>
                                    </span>
                                </asp:LinkButton>
                                <asp:LinkButton runat="server" ID="IndexImgRemoveFilterCM" OnClick="IndexImgRemoveFilter_OnClick" Enabled="false" CssClass="clickableRight">
                                    <span id="spanRemoveFilter">
                                        <i class="fa fa-filter"></i>
                                        <i class="fa fa-minus"></i>
                                    </span>
                                </asp:LinkButton>
                                <asp:LinkButton runat="server" ID="IndexImgExportCM" OnClientClick="return ajaxModalPopupExportDati();" CssClass="clickableRight">
                                    <i class="fa fa-file-excel-o"></i>
                                </asp:LinkButton>                                    
                                <asp:LinkButton runat="server" ID="IndexImgSmistaCM" OnClick="IndexImgSmista_OnClick" CssClass="clickableRight">
                                    <span id="spanSmista">
                                        <i class="fa fa-file-o"></i>
                                        <i class="fa fa-arrow-right"></i>
                                    </span>
                                </asp:LinkButton>
                                <asp:LinkButton runat="server" ID="IndexImgDeleteCM" OnClick="IndexImgRemove_OnClick" CssClass="clickableRight">
                                    <i class="fa fa-trash-o"></i>
                                </asp:LinkButton>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>                    
                <!-- Main notifications container -->
                <div id="containerListNotify" style="padding-left: 5px;">
                    <asp:UpdatePanel ID="UpdatePanelRepListNotify" runat="server" UpdateMode="Conditional" ClientIDMode="Static">
                        <ContentTemplate>
                            <!-- DEFINISCE LA STRUTTURA DELLE NOTIFICHE -->
                            <asp:Repeater ID="repListNotify" runat="server" OnItemCommand="RepListNotify_ItemCommand"
                                OnItemDataBound="RepListNotify_ItemCreated">
                                <HeaderTemplate>
                                    <table id="tableCentroMessaggi" class="table table-hover">
                                        <thead>
                                            <tr id="HeaderMessaggi">
                                                <th>                                                   
                                                    <asp:Label runat="server" ID="docFascCol"  Text='<%#this.getDocFascColText() %>' />
                                                </th>
                                                <th>
                                                    <asp:Label runat="server" ID="dataCol"  Text='<%#this.getDataColText() %>' />
                                                </th>
                                                <th>
                                                    <asp:Label runat="server" ID="eventCol"  Text='<%#this.getEventColText() %>' />
                                                </th>
                                                <th>
                                                   <asp:Label runat="server" ID="fromCol"  Text='<%#this.getSenderColText() %>' />
                                                </th>
                                                <th>
                                                   <asp:Label runat="server" ID="objDescCol"  Text='<%#this.getObjDescColText() %>' />
                                                </th>
                                                <th>
                                                    <asp:Label runat="server" ID="tipologyCol"  Text='<%#this.getTipologyColText() %>' />
                                                </th>
                                                <th>
                                                    <asp:Label runat="server" ID="senderCol"  Text='<%#this.getEmailColText() %>' />
                                                </th>
                                                <th>
                                                    <asp:Label runat="server" ID="noteCol"  Text='<%#this.getNoteColText() %>' />
                                                </th>
                                                <th>
                                                    <asp:Label runat="server" ID="actionsCol"  Text='<%#this.getActionsColText() %>' />
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr id="messageRow" runat="server">
                                        <td id="messageDetails">
                                            <div>
                                                <!-- checkbox rimozione notifica -->
                                                <asp:CheckBox ID="IndexChkRemoveNotify" CssClass="clickableLeftN" runat="server" />
                                                <!-- icona dettagli documento/fascicolo -->
                                                <asp:LinkButton runat="server" ID="IndexImgDetailsDocument" CommandName="ViewDetailsDocument" CssClass="clickableRight">
                                                </asp:LinkButton>
                                                <!-- id -->
                                                <br />
                                                <div class="notifyField">
                                                    <span class="noLink">
                                                        <asp:LinkButton ID="lblNotifyLink" runat="server" Text='<%#this.getLabelFieldLink((NttDataWA.DocsPaWR.Notification) Container.DataItem) %>' CommandName="viewLinkObject" OnClientClick="disallowOpHome('Content2');">
                                                        </asp:LinkButton>
                                                    </span>
                                                </div>
                                            </div>
                                        </td>

                                        <td id="date">
                                            <asp:Label ID="IndexLblDate" runat="server" Text='<%# Bind("DTA_EVENT") %>'></asp:Label>
                                        </td>

                                        <td id="mexEvent">
                                            <asp:Label ID="Label2" runat="server" Text='<%# GetEvent((NttDataWA.DocsPaWR.Notification) Container.DataItem) %>'></asp:Label>
                                        </td>

                                        <td id="mexSender">
                                            <asp:Label ID="Label3" runat="server" Text='<%# GetSource((NttDataWA.DocsPaWR.Notification) Container.DataItem) %>'></asp:Label>
                                        </td>

                                        <td id="objDescription">
                                            <asp:Label ID="Label4" runat="server" Text='<%# GetObjDesc((NttDataWA.DocsPaWR.Notification) Container.DataItem) %>'></asp:Label>
                                        </td>

                                        <td id="tipology">
                                            <asp:Label ID="Label5" runat="server" Text='<%# GetData((NttDataWA.DocsPaWR.Notification) Container.DataItem, Column.Tipology) %>'></asp:Label>
                                        </td>

                                        <td id="mittente">
                                            <asp:Label ID="Label7" runat="server" Text='<%# GetData((NttDataWA.DocsPaWR.Notification) Container.DataItem, Column.Sender) %>'></asp:Label>
                                        </td>

                                        <td id="note">
                                            <div id="containerNoteNotify" runat="server">
                                                <div class="fieldNotesHome">
                                                    <div class="fieldNotesHomeBt">
                                                        <div class="weight">
                                                            <asp:Label ID="lblNotes" Text='<%$ localizeByText:IndexLblNotes%>' runat="server"
                                                                Visible="false"></asp:Label>
                                                        </div>
                                                        <div style="padding-top: 30px; padding-left: 55px;">
                                                            <cc1:CustomTextArea ID="txtNoteNotify" runat="server" TextMode="MultiLine" ClientIDMode="Static"
                                                                CssClass="homeNotes">
                                                            </cc1:CustomTextArea>
                                                        </div>
                                                        <div style="text-align: right;">
                                                            <asp:Button ID="litSaveNotes" Text='<%$ localizeByText:IndexLitSaveNotes%>' CommandName="SaveNotesNotify"
                                                                runat="server" CssClass="buttonNotes" ImageAlign="Right"></asp:Button>
                                                            <asp:Button ID="litRemoveNotes" Text='<%$ localizeByText:IndexLitRemoveNotes%>' CommandName="RemoveNotesNotify"
                                                                runat="server" CssClass="buttonNotes" ImageAlign="Right"></asp:Button>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </td>
                                        <!-- these buttons generate the issue -->
                                        <td id="actionsButtons">
                                            <div id="actionsButtonsContainer">
                                                <asp:LinkButton runat="server" ID="btnTypeDocCM" CommandName="ViewDocument" CssClass="clickableLeft"
                                                    ToolTip='<%$ localizeByText:IndexBtnTypeDocTooltip%>'>
                                                        <i class="fa fa-search"></i>
                                                </asp:LinkButton>
                                                <asp:LinkButton runat="server" ID="btnSignatureDetails" CommandName="SignatureDetails" CssClass="clickable"
                                                    ToolTip='<%$ localizeByText:DocumentSignatureDetails%>' Visible="false">
                                                        <i class="dettaglioFirma">&#xe800;</i>
                                                </asp:LinkButton>
                                                <asp:LinkButton runat="server" ID="IndexImgAdd" CommandName="AddNote" CssClass="clickableLeft"
                                                    Visible='<%#GetEnableNote() %>'>
                                                        <span class="fa-stack">
                                                            <i class="fa fa-file-o fa-stack-2x"></i>
                                                            <i class="fa fa-plus fa-stack-1x"></i>
                                                        </span>
                                                </asp:LinkButton>
                                                <asp:LinkButton runat="server" ID="IndexImgRemoveNotify" CommandName="RemoveNotify" CssClass="clickableRight">
                                                        <i class="fa fa-trash-o"></i>
                                                </asp:LinkButton>
                                            </div>
                                        </td>
                                    </tr>
                                    <asp:HiddenField runat="server" ID="NotifyId" Value='<%# Bind("ID_NOTIFY") %>' />
                                </ItemTemplate>
                                <FooterTemplate>
                                    </tbody>   
                                    </table>                                     
                                </FooterTemplate>
                            </asp:Repeater>
                            <asp:HiddenField ID="grid_rowindex" runat="server" ClientIDMode="Static" />
                            <asp:HiddenField ID="HiddenRemoveNotifications" runat="server" ClientIDMode="Static" />
                            <asp:HiddenField ID="HiddenRemoveNotification" runat="server" ClientIDMode="Static" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <asp:HiddenField ID="grid_pageindex" runat="server" ClientIDMode="Static" />
                <asp:UpdatePanel ID="upPnlGridIndexes" runat="server" ClientIDMode="Static" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div id="navHome">
                            <asp:PlaceHolder ID="plcNavigator" runat="server" />
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>

我沒有任何錯誤。

更新: “ UpPnlBAction” UpdatePanel中的所有控件均不起作用。

嘗試在更新面板中添加ChildrenAsTriggers ="false"然后查看

https://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.childrenastriggers(v=vs.110).aspx

檢查這是否解決了您的問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM