Error using Updatepanel: "A control with the btnAbrirDoc identification was not found for the trigger in 'Updatepanel'

Asked

Viewed 12 times

-1

Follow the code below:


    <div class="row">
        <div class="col-md-2">
            <asp:Label ID="lblMsg" runat="server"></asp:Label>
        </div>
    </div>

    <div class="corpoFav">
        <div class="listDoc">
            <h2 style="margin-top: 0px; font-size: 21px; margin-left: 43px;">Lista de Documentos Favoritos</h2>

            <div class="listaDeDocumentos">
                        <asp:DataList
                            ID="DataList1"
                            runat="server"
                            OnSelectedIndexChanged="DataList1_SelectedIndexChanged"
                            OnItemDataBound="DataList1_ItemDataBound"
                            OnItemCommand="DataList1_ItemCommand" Width="550px" HorizontalAlign="Justify">
                            <ItemTemplate>
                                <table class="table">
                                    <tr align="justify">
                                        <td>
                                            <asp:Label runat="server" ID="lblFavorito"></asp:Label></td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Button runat="server" ID="btnAbrirDoc" CommandArgument='<%# Eval("ID") %>' Text="Visualizar documento" CommandName="Abrir" CssClass="btn btn-default" />
                                            <asp:Button runat="server" ID="btnExcluirDoc" CommandArgument='<%# Eval("ID") %>' Text="Desfavoritar documento" CommandName="Excluir" CssClass="btn btn-danger" />
                                        </td>
                                    </tr>
                                </table>

                            </ItemTemplate>
                        </asp:DataList>
            </div>

            <table class="btnPaging">
                <tr>
                    <td>
                        <asp:Button ID="Button1" runat="server" Font-Bold="true" Text="Início" OnClick="Button1_Click" CssClass="btn bg-primary" />
                    </td>
                    <td>
                        <asp:Button ID="Button2" runat="server" Font-Bold="true" Text="Anterior" OnClick="Button2_Click" CssClass="btn bg-primary" />
                    </td>
                    <td>
                        <asp:Button ID="Button3" runat="server" Font-Bold="true" Text="Próximo" OnClick="Button3_Click" CssClass="btn bg-primary" />
                    </td>
                    <td>
                        <asp:Button ID="Button4" runat="server" Font-Bold="true" Text="Último" OnClick="Button4_Click" CssClass="btn bg-primary" />
                    </td>
                </tr>
            </table>
        </div>

        <div class="visualizar">
            <h2 style="margin-top: 0px; font-size: 21px">Visualizar o documento</h2>
            <div class="interno">
                <asp:UpdatePanel runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <iframe runat="server" id="frameDoc" width="100%" height="690" frameborder="0" scrolling="no"></iframe>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnAbrirDoc" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </div>
        </div>
    </div>
</asp:Content>```
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.