如何触发UpdatePanel [英] How to Trigger UpdatePanel

查看:69
本文介绍了如何触发UpdatePanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





根据以下代码段,我有2个更新面板。虽然第一个被触发,但我无法触发第二个(更新面板以粗体突出显示并且下划线不可见),因此其中没有任何内容在页面上可见。我在内容模板后添加了一个触发器但没有任何成功。非常感谢任何帮助。



Hi,

I have 2 Update Panels as per the below code snippet. While the first is getting triggered, I am somehow not able to trigger the second one (Update Panel Highlighted in bold and underlined is not visible) and hence none of the contents therein are visible on the page. I have added a Trigger after the Content Template without any success though. Any help is much appreciated.

<asp:Panel ID="ActivityLogRptPanel" HorizontalAlign="Center" runat="server">
    <ajax:UpdatePanel ID="ActivityLogUpdatePanel"  runat="server" ChildrenAsTriggers="false"

        RenderMode="Inline" UpdateMode="Conditional">
        <contenttemplate>
            <br />
            <table id="tblActivityLog" style="border-collapse: collapse; border-spacing: 0; padding: 0;<br mode=" hold=" />                width: 100%;" align="left">
                <tr>
                    <td style="align-self: center">
                        <table class="TblReportHeader" id="tblActivityLogHeader" style="align-self: center;<br mode=" hold=" />                            border-collapse: collapse; border-spacing: 0; padding: 0; border-right: #91c9c9 1px solid;<br mode=">
                            <tr style="height: 23px">
                                <td width="8px">
                                </td>
                                <td align="left" width="980px">
                                    <asp:Label runat="server" ID="RptCriteriaLabel" ForeColor="#930000">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="align-self: center">
                        <telerik:RadGrid  runat="server" ID="ActivityLogRptRadGrid" Height="320px" Width="990px"

                            AutoGenerateColumns="False" CellPadding="0" GridLines="Both" AllowSorting="false"

                            AllowPaging="false" EnableEmbeddedSkins="false" BackColor="Transparent" HorizontalAlign="left"

                            OnExcelMLExportStylesCreated="ActivityLogRptRadGrid_StyleCreated" >
                           
                        
                        <uc1:CustomPager ID="customPager"  runat="server" />
                    </td>
                </tr>
            </table>
        </contenttemplate>
        <triggers>
            <ajax:asyncpostbacktrigger controlid="ActivityLogRptRadGrid" xmlns:ajax="#unknown" />
        </triggers>
    
    <ajax:UpdatePanel RenderMode="Inline" ID="ContainButtonsUpdatePanel"  runat="server"

        UpdateMode="Conditional" ChildrenAsTriggers="false">        <contenttemplate>
            <table class="tblformat">
                <tr>
                    <td>
                       <table>
                            <tr style="height: 2%">
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table id="tblButtonsStatement" style="border-collapse: collapse; border-spacing: 0;<br mode=" hold=" />                                        padding: 0; width: 100%; height: 50px; border: 0">
                                        <tr>
                                            <td style="vertical-align: bottom; width: 40%;">
                                                <table id="tblTotals" style="border-collapse: collapse; border-spacing: 0; padding: 0;<br mode=" hold=" />                                                    border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid;<br mode=">
                                                    <tr style="height: 40%">
                                                        <td class="TblHeader" style="vertical-align: middle; border-removed black 1px solid;<br mode=" hold=" />                                                            background-color: #91C9C9;" colspan="3">
                                                            <asp:Label ID="TotalsLabel" Font-Size="12px" Font-Bold="True" runat="server">Status Update Totals
                                                        </td>
                                                    </tr>
                                                    <tr style="height: 30%">
                                                        <td style="border-removed black 1px solid">
                                                            <asp:Label ID="ConditionAffirmedLabel" runat="server" Font-Size="12px">Conditions AFFIRMED
                                                        </td>
                                                        <td style="border-removed black 1px solid; border-removed black 1px solid">
                                                              
                                                        </td>
                                                        <td style="border-removed black 1px solid">
                                                            <asp:Label ID="ConAffirmedValuesLabel" runat="server" Font-Size="12px">0
                                                        </td>
                                                    </tr>
                                                    <tr style="height: 30%">
                                                        <td>
                                                            <asp:Label ID="ConDeniedLabel" runat="server" Font-Size="12px">Conditions DENIED
                                                        </td>
                                                        <td style="border-removed black 1px solid; width: 5%">
                                                              
                                                        </td>
                                                        <td width="20%">
                                                            <asp:Label ID="ConDeniedValueLabel" runat="server" Font-Size="12px">0
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td style="vertical-align: middle; width: 30%;">
                                                <ajax:UpdateProgress  runat="server" ID="UpdateProgressLinkButton" AssociatedUpdatePanelID="ActivityLogUpdatePanel">
                                                
                                            </td>
                                            <td style="vertical-align: middle; width: 10%">
                                                <asp:Button ID="PrintButton" runat="server" CausesValidation="False" Width="50px"

                                                    Text="Print" Visible="false" Height="30px" Font-Bold="True" OnClick="PrintButton_Click">
                                                
                                            </td>
                                            <td style="vertical-align: middle; width: 10%">
                                            </td>
                                            <td style="height: 30px; vertical-align: middle; width: 10%">
                                                <button id="ExportButton" type="button" alt="Excel"  runat="server" accesskey="x"

                                                    >
                                                    Export to Excel
                                                </button>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </contenttemplate>
        <triggers>
            <ajax:postbacktrigger controlid="ExportButton" xmlns:ajax="#unknown" />
        </triggers>
    





The information transmitted is intended only for the person or entity to which it is addressed

and may contain CONFIDENTIAL material. If you receive this material/information in error,

please contact the sender and delete or destroy the material/information.



The information transmitted is intended only for the person or entity to which it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information in error,
please contact the sender and delete or destroy the material/information.

推荐答案

I can’t see any closing tag for your update panels like </ajax:UpdatePanel>



The most likely scenario is that asp is trying to fix this issue by adding closing tags, but in the wrong places. You need to close of both update panels in the markup:





I can't see any closing tag for your update panels like </ajax:UpdatePanel>

The most likely scenario is that asp is trying to fix this issue by adding closing tags, but in the wrong places. You need to close of both update panels in the markup:


<asp:Panel ID="ActivityLogRptPanel" HorizontalAlign="Center" runat="server">
    <ajax:UpdatePanel ID="ActivityLogUpdatePanel"  runat="server" ChildrenAsTriggers="false"

        RenderMode="Inline" UpdateMode="Conditional">
        <contenttemplate>
            <br />
            <table id="tblActivityLog" style="border-collapse: collapse; border-spacing: 0; padding: 0;<br mode=" hold=" />                width: 100%;" align="left">
                <tr>
                    <td style="align-self: center">
                        <table class="TblReportHeader" id="tblActivityLogHeader" style="align-self: center;<br mode=" hold=" />                            border-collapse: collapse; border-spacing: 0; padding: 0; border-right: #91c9c9 1px solid;<br mode=">
                            <tr style="height: 23px">
                                <td width="8px">
                                </td>
                                <td align="left" width="980px">
                                    <asp:Label runat="server" ID="RptCriteriaLabel" ForeColor="#930000">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="align-self: center">
                        <telerik:RadGrid  runat="server" ID="ActivityLogRptRadGrid" Height="320px" Width="990px"

                            AutoGenerateColumns="False" CellPadding="0" GridLines="Both" AllowSorting="false"

                            AllowPaging="false" EnableEmbeddedSkins="false" BackColor="Transparent" HorizontalAlign="left"

                            OnExcelMLExportStylesCreated="ActivityLogRptRadGrid_StyleCreated" >
                           
                        
                        <uc1:CustomPager ID="customPager"  runat="server" />
                    </td>
                </tr>
            </table>
        </contenttemplate>
        <triggers>
            <ajax:asyncpostbacktrigger controlid="ActivityLogRptRadGrid" xmlns:ajax="#unknown" />
        </triggers>
    </ajax:UpdatePanel> 
    <ajax:UpdatePanel RenderMode="Inline" ID="ContainButtonsUpdatePanel"  runat="server"

        UpdateMode="Conditional" ChildrenAsTriggers="false">       <contenttemplate>
            <table class="tblformat">
                <tr>
                    <td>
                       <table>
                            <tr style="height: 2%">
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table id="tblButtonsStatement" style="border-collapse: collapse; border-spacing: 0;<br mode=" hold=" />                                        padding: 0; width: 100%; height: 50px; border: 0">
                                        <tr>
                                            <td style="vertical-align: bottom; width: 40%;">
                                                <table id="tblTotals" style="border-collapse: collapse; border-spacing: 0; padding: 0;<br mode=" hold=" />                                                    border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid;<br mode=">
                                                    <tr style="height: 40%">
                                                        <td class="TblHeader" style="vertical-align: middle; border-removed black 1px solid;<br mode=" hold=" />                                                            background-color: #91C9C9;" colspan="3">
                                                            <asp:Label ID="TotalsLabel" Font-Size="12px" Font-Bold="True" runat="server">Status Update Totals
                                                        </td>
                                                    </tr>
                                                    <tr style="height: 30%">
                                                        <td style="border-removed black 1px solid">
                                                            <asp:Label ID="ConditionAffirmedLabel" runat="server" Font-Size="12px">Conditions AFFIRMED
                                                        </td>
                                                        <td style="border-removed black 1px solid; border-removed black 1px solid">
                                                              
                                                        </td>
                                                        <td style="border-removed black 1px solid">
                                                            <asp:Label ID="ConAffirmedValuesLabel" runat="server" Font-Size="12px">0
                                                        </td>
                                                    </tr>
                                                    <tr style="height: 30%">
                                                        <td>
                                                            <asp:Label ID="ConDeniedLabel" runat="server" Font-Size="12px">Conditions DENIED
                                                        </td>
                                                        <td style="border-removed black 1px solid; width: 5%">
                                                              
                                                        </td>
                                                        <td width="20%">
                                                            <asp:Label ID="ConDeniedValueLabel" runat="server" Font-Size="12px">0
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td style="vertical-align: middle; width: 30%;">
                                                <ajax:UpdateProgress  runat="server" ID="UpdateProgressLinkButton" AssociatedUpdatePanelID="ActivityLogUpdatePanel">
                                                
                                            </td>
                                            <td style="vertical-align: middle; width: 10%">
                                                <asp:Button ID="PrintButton" runat="server" CausesValidation="False" Width="50px"

                                                    Text="Print" Visible="false" Height="30px" Font-Bold="True" OnClick="PrintButton_Click">
                                                
                                            </td>
                                            <td style="vertical-align: middle; width: 10%">
                                            </td>
                                            <td style="height: 30px; vertical-align: middle; width: 10%">
                                                <button id="ExportButton" type="button" alt="Excel"  runat="server" accesskey="x"

                                                    >
                                                    Export to Excel
                                                </button>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </contenttemplate>
        <triggers>
            <ajax:postbacktrigger controlid="ExportButton" xmlns:ajax="#unknown" />
        </triggers>
      </ajax:UpdatePanel> 


这篇关于如何触发UpdatePanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆