ASP.Net Error: A control with ID dlQuestionList could not be found for the trigger in UpdatePanel upShowDetails

Last Reply 7 months ago By Amol111

Posted 7 months ago

I have user below code but i am unable to find the Datalist id in updatepanel trigger. below is the error message and sample code.

Please suggest any solution.(After clcik on radiobutton list page getting postback to avoid postback let me know the solution)

Thanks

 Error Message : A control with ID 'dlQuestionList' could not be found for the trigger in UpdatePanel 'upShowDetails'.

<asp:UpdatePanel ID="upShowDetails" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="dlQuestionList" />
    </Triggers>
    <ContentTemplate>
        <div class="panel panel-danger">
            <ajaxtoolkit:accordion id="Accordion1" runat="server" transitionduration="100" selectedindex="-1"
                framespersecond="200" fadetransitions="true" requireopenedpane="false" onitemdatabound="Accordion1_ItemDataBound"
                contentcssclass="accordion-content" headercssclass="accordion-header" headerselectedcssclass="accordion-selected"
                visible="true">
                <HeaderTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "GP_Name")%>   
                </HeaderTemplate>

                <ContentTemplate>
                    <asp:HiddenField ID="hdfGP_ID" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"GP_ID") %>' />

                    <asp:DataList ID="dlQuestionList" runat="server" OnItemDataBound="dlQuestionList_OnItemDataBound">
                        <ItemTemplate>
                            <div class="question-section">
                                <p class="lblSectionHeading">
                                    <asp:Label ID="lblSectionHeading" Visible="false" runat="server" ClientIDMode="Static" />
                                </p>
                                <asp:Label ID="lblRowID" runat="server" Text='<%# Bind("ID") %>' Visible="false" />
                                <p id="lblQuestionName" runat="server" class="lblQuestionName">
                                    <%# Eval("QUESTION") %>
                                </p>
                                <asp:RadioButtonList ID="rbnRatingList" runat="server" RepeatDirection="Horizontal"
                                    CellPadding="3" CellSpacing="3" AutoPostBack="true" CssClass="rbnRatingList"
                                    ToolTip="Ratings" DataTextField="RATINGNAME" DataValueField="ID" />
                            </div>
                        </ItemTemplate>
                    </asp:DataList>
                </ContentTemplate>
            </ajaxtoolkit:accordion>
        </div>
        <div class="button-section">
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" CommandName="Submit" OnCommand="SubmitSurvey"
                ToolTip="Submit" CssClass="Pbigbtn" />
            <asp:Button ID="btnCancel" runat="server" Text="Clear" CommandName="Clear" OnCommand="SubmitSurvey"
                ToolTip="Clear" CssClass="Pbigbtn" />
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

 

 

Posted 7 months ago Modified on 7 months ago

Thanks for the Details. 

I have used below code and now its working as expected. Thanks

AutoPostBack="false"

<asp:RadioButtonList ID="rbnRatingList" runat="server" RepeatDirection="Horizontal" CellPadding="3" CellSpacing="3" AutoPostBack="false" CssClass="rbnRatingList" ToolTip="Ratings" DataTextField="RATINGNAME" DataValueField="ID" />

                                <div class="panel panel-danger">
                                    <AjaxToolkit:Accordion ID="Accordion1" runat="server" TransitionDuration="100" SelectedIndex="-1" FramesPerSecond="200"
                                        FadeTransitions="true"
                                        RequireOpenedPane="false" OnItemDataBound="Accordion1_ItemDataBound"
                                        ContentCssClass="accordion-content" HeaderCssClass="accordion-header" HeaderSelectedCssClass="accordion-selected" Visible="true">

                                        <HeaderTemplate>
                                            <asp:Label ID="Label1" runat="server" Text=' <%# Container.DataItemIndex + 1 +")" %>' ToolTip="Guiding Principle"></asp:Label>
                                            <asp:Label ID="lblGP_Name" runat="server" Text=' <%#Eval("GP_Name")%>' ToolTip="Guiding Principle"></asp:Label>

                                        </HeaderTemplate>
                                        <ContentTemplate>
                                            <asp:HiddenField ID="hdfGP_ID" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"GP_ID") %>' />
                                            <asp:DataList ID="dlQuestionList" runat="server" OnItemDataBound="dlQuestionList_OnItemDataBound">
                                                <ItemTemplate>
                                                    <div class="question-section">
                                                        <p class="lblSectionHeading">
                                                            <asp:Label ID="lblSectionHeading" Visible="false" runat="server" ClientIDMode="Static" />
                                                        </p>
                                                        <asp:Label ID="lblRowID" runat="server" Text='<%# Bind("ID") %>' Visible="false" />
                                                        <p id="lblQuestionName" runat="server" class="lblQuestionName">
                                                            <%# Eval("QUESTION") %>
                                                        </p>

                                                      
                                                        <asp:RadioButtonList ID="rbnRatingList" runat="server" RepeatDirection="Horizontal"
                                                            CellPadding="3" CellSpacing="3" AutoPostBack="false" CssClass="rbnRatingList"
                                                            ToolTip="Ratings" DataTextField="RATINGNAME" DataValueField="ID" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:DataList>
                                        </ContentTemplate>
                                    </AjaxToolkit:Accordion>
                                </div>