locked
accordinepane1 onclick event RRS feed

  • Question

  • User-425599523 posted

    Hi The theard continues on from this

    http://forums.asp.net/t/1934206.aspx?accordinepane1+onclick+event

    After adding this,

    <asp:AsyncPostBackTrigger ControlID = "Accordion1$AccordionPane1$LinkButton2" EventName = "Click" />

    im getting this error

    A control with ID 'Accordion1$AccordionPane1$LinkButton2' could not be found for the trigger in UpdatePanel 'UpdatePanel2'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: A control with ID 'Accordion1$AccordionPane1$LinkButton2' could not be found for the trigger in UpdatePanel 'UpdatePanel2'.

    Tuesday, September 10, 2013 4:27 AM

Answers

  • User-417640953 posted

    Hello,

    After browsing your previous post I see that you want to set the linkbutton which inside an Accordion as the trigger of UpdatePanel.

    As we all know that the control that the AsyncPostBackTrigger references must be in the same naming container as the update panel for which it is a trigger.

    Triggers that are based on controls in other naming containers are not supported.   

      please refer to: http://msdn.microsoft.com/en-us/library/system.web.ui.inamingcontainer.aspx

    What we should  do is to refresh the UpdatePanel programmatically.

    For this issue, someone has provided a solution.

       http://forums.asp.net/t/1199130.aspx

    Hope this helps, thanks.

     

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 16, 2013 11:53 PM

All replies

  • User-227760790 posted

    hi bsarahim ,

    I look at the theard :

    Re: accordinepane1 onclick event
    
    18 hours, 27 minutes ago|LINK
    
    
    Thanks alot! It works fine!Cool I want to add further more...
    
    but im confused on triggers part, where im using in updatepanel
    
    <triggers>
    
    <asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="Click" />
    
    </triggers>
    
    1. it shows the error the linkbutton2 is not find
    
    2. ajax-loader.gif does not show when I click on linkbutton2.
    
    
    -----------------------------------------------
    
    <asp:UpdateProgress ID="UpdateProgress1" runat="server"
     AssociatedUpdatePanelID="UpdatePanel2" DisplayAfter="50">
                 <ProgressTemplate>
          
    
               <div id="dvProgress1" runat="server" style="; top: 300px;
                                                        left: 550px; text-align:center;">
                 <asp:Image ID="Image21" runat="server" Height="46px" Width="47px"
                            ImageUrl="../gifs/ajax-loader.gif"  AlternateText="loader" />
                            </div>
                    
                    
                 </ProgressTemplate>
             </asp:UpdateProgress>
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
               <Triggers>
          
             </Triggers>
      
               <ContentTemplate>
    
      
      <asp:Accordion ID="Accordion1" runat="server" SelectedIndex="0" HeaderCssClass="exp-c"
     HeaderSelectedCssClass="exp-c" ContentCssClass=""
     FadeTransitions="true" SuppressHeaderPostbacks="False" TransitionDuration="250" FramesPerSecond="40" RequireOpenedPane="False" AutoSize="None" >
    
      
          <Panes>
         
          
           <asp:AccordionPane ID="AccordionPane1" runat="server">
     <Header> <div style="width:100%;" onclick="__doPostBack('<%=LinkButton2.UniqueID %>', '');">
        <asp:LinkButton ID="LinkButton2" OnClick="LinkButton2_Click" runat="server">Visited Products</asp:LinkButton></div>
     </Header>
              
     <Content>

    you can  post your important complete html markup and code-behind  or give us a simple demo  in order to btter help you solve the problem.

    Tuesday, September 10, 2013 5:45 AM
  • User-417640953 posted

    Hello,

    After browsing your previous post I see that you want to set the linkbutton which inside an Accordion as the trigger of UpdatePanel.

    As we all know that the control that the AsyncPostBackTrigger references must be in the same naming container as the update panel for which it is a trigger.

    Triggers that are based on controls in other naming containers are not supported.   

      please refer to: http://msdn.microsoft.com/en-us/library/system.web.ui.inamingcontainer.aspx

    What we should  do is to refresh the UpdatePanel programmatically.

    For this issue, someone has provided a solution.

       http://forums.asp.net/t/1199130.aspx

    Hope this helps, thanks.

     

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 16, 2013 11:53 PM