views:

501

answers:

2

I have a FileUpload Controller and Button inside an AJAX Accordion which I can't get working. The problem is that the FileUpload Controller requires a full postback for it to work. However, since the control is inside an update panel, asp is deciding to do a partial postback. Usually, you would just put the ControlId into a trigger on the update panel. However, because the accordion uses a different namespace, you are unable to do this (at least directly).

How would you propose I solve this problem?

+1  A: 

You can set the ChildrenAsTriggers property to false on the updatepanel potentially along with the UpdateMode being conditional. Then any updates to the panel would need to be explicity coded. Never tried it, but it may work.

RSolberg
A: 

You can put the control ID into a postback trigger as long as the accordion panes each have their own update panel.

                                <ajaxToolkit:AccordionPane
                                HeaderCssClass="accordionHeader"
                                HeaderSelectedCssClass="accordionHeaderSelected"
                                ContentCssClass="accordionContent">
                                <Header><asp:LinkButton ID="lbtnOption1" runat="server">Option 1</asp:LinkButton></Header>
                                <Content>
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                             /* Put HtmlInputFile and upload button here*/
                                        </ContentTemplate>                  
                                        <Triggers>
                                              <asp:PostBackTrigger ControlID="btnUpload" />
                                        </Triggers></asp:UpdatePanel>                                        
                                </Content>
                            </ajaxToolkit:AccordionPane>