I have a master page that I'm setting up. On the left side is an accordion control. This is going to server as my menu for the website. When the user clicks on a panel header, obviously, the content opens up. I could link to PDF's, HTML, ASPX, etc.
When they click on a link to another page in my website, it does a postback. Now in a perfect world, if they were in Accordion "Panel C" when they clicked on that link to another page in my site, it would do the postback, that page would be displayed, and
the content under "Panel C" would still be shown. However, I can't get that to work. If I set selectedindex on the header to -1 or 0, it doesn't do what I want it to do. I had EnableViewState set to true at one point and I couldn't get that to work. So,
how do I maintain which panel was open between postbacks? Any feedback would be appreciated.
The problem can be viewed in action, if you like, by going to southportlandrelay.org. Site's still in development, so there's next to nothing out there at the moment, but you can see the problem. Click "Help" and the menu pops up. Click the "Contact Us"
item, and you'll be taken to that page, but instead of having the "Help" menu still open, the "About" one is.
What am I missing here? Thanks in advance!
"AJAX Toolkit"Accordion Controlajax masterpage postbackajax menu masterpage postbackAjax Control Toolkit 1.0problem
Bubba627
Member
1 Points
17 Posts
Maintaining Accordion panel selected state between pages
Sep 28, 2007 04:03 PM|LINK
Hi,
I have a master page that I'm setting up. On the left side is an accordion control. This is going to server as my menu for the website. When the user clicks on a panel header, obviously, the content opens up. I could link to PDF's, HTML, ASPX, etc. When they click on a link to another page in my website, it does a postback. Now in a perfect world, if they were in Accordion "Panel C" when they clicked on that link to another page in my site, it would do the postback, that page would be displayed, and the content under "Panel C" would still be shown. However, I can't get that to work. If I set selectedindex on the header to -1 or 0, it doesn't do what I want it to do. I had EnableViewState set to true at one point and I couldn't get that to work. So, how do I maintain which panel was open between postbacks? Any feedback would be appreciated.
A partial snippet of my code:
<ajaxToolkit:Accordion ID="Accordion1" runat="server" AutoSize="None" FadeTransitions="false" Width="100%" HeaderCssClass="accordionHeader" ContentCssClass="accordionContent" RequireOpenedPane="false">
<Panes>
<ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server">
<Header><a href="" onclick="return false;">About</a></Header>
<Content>Item 1<br />Item 2<br />Item 3</Content>
</ajaxToolkit:AccordionPane>
<ajaxToolkit:AccordionPane ID="AccordionPane5" runat="server">
<Header><a href="" onclick="return false;">Luminaria</a></Header>
<Content>Item 1<br />Item 2<br />Item 3</Content>
</ajaxToolkit:AccordionPane>
<ajaxToolkit:AccordionPane ID="AccordionPane7" runat="server">
<Header><a href="" onclick="return false;">Help</a></Header>
<Content>
<p>
<asp:HyperLink ID="lnkFAQ" runat="server" NavigateUrl="">Frequently Asked Questions (FAQ)</asp:HyperLink><br />
<asp:HyperLink ID="lnkDirections" runat="server" NavigateUrl="">Driving Directions</asp:HyperLink><br />
<asp:HyperLink ID="lnkContact" runat="server" NavigateUrl="~/help/contactus.aspx">Contact Us</asp:HyperLink>
</p>
</Content>
</ajaxToolkit:AccordionPane>
</Panes>
</ajaxToolkit:Accordion>
The problem can be viewed in action, if you like, by going to southportlandrelay.org. Site's still in development, so there's next to nothing out there at the moment, but you can see the problem. Click "Help" and the menu pops up. Click the "Contact Us" item, and you'll be taken to that page, but instead of having the "Help" menu still open, the "About" one is.
What am I missing here? Thanks in advance!
"AJAX Toolkit" Accordion Control ajax masterpage postback ajax menu masterpage postback Ajax Control Toolkit 1.0 problem