Monday, March 26, 2012

UpdatePanel & AccordionExtender

To all,

this is what i have so far.. a nested repeater that displays info from a datasource... the repeaters sits inside a updatepanel which has a conditional mode that should re-render (dont know if thats the right terminology) itself base on an event...

now.. i have so far managed to get the accordion extender working such that the updatepanel re-render itself to give out the right data... but ONLY if the scriptmanager having the PartialRendering as false... ie.. the re-rendering works if the whole page is rendered... the the partial rendering is true... the repeated accordion inside the update panel all expands and the accordion action no longer works... pretty much to the point where its similar to a treeview...

below is a snippet of my code...

<div id="navigation_left" runat="server" class="accordionSpan" >
<asp:Panel ID="Panel2" runat="server">
<atlas:UpdatePanel ID="UpdatePanel1" Mode="Conditional" runat="server" RenderMode="Inline">
<Triggers>
<atlas:ControlEventTrigger ControlID="StateRadioBtnLst" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:Repeater ID="rMyRepeater" runat="server">
<ItemTemplate>
<span id="Accordion1Pane">
<div><div class="accordionHeader">
<%# Eval("Name") %>
</div></div>
<div><div class="accordionContent">
<asp:Repeater ID="rMyRepeater1" runat="server" DataSource='<%# ((BusinessObjects.MatterCategorieJoin)Container.DataItem).MatterType %>'>
<ItemTemplate>
<div><%# ((BusinessObjects.MatterType)(Container.DataItem)).Name%></div>
</ItemTemplate>
</asp:Repeater>
</div></div></span>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel>
</div>

<atlas:AccordionExtender ID="AccordionExtender1" runat="server">
<atlas:AccordionProperties
TargetControlID="UpdatePanel1"
AutoSize="None"
SelectedIndex="0"
FadeTransitions="false"
FramesPerSecond="80"
TransitionDuration="150"/>
</atlas:AccordionExtender>

anyone with any idea of help??...
thanks to all who replies...

Hi tony_c,

Part of the problem is that you don't seem to have the right hierarchy of HTML elements. Check out the posthttp://forums.asp.net/thread/1333093.aspx to see how the divs and span should be nested. I would also recommend that you don't use the UpdatePanel as the TargetControlID. I'm not sure this is causing your problems, but it looks suspect.

Thanks,
Ted

No comments:

Post a Comment