Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hello guys. I just want to ask, how to know the selectedIndex of an Ajax Accordion. I looked all over the web and found no luck in getting the answer. I was able to find some that suggested the use of jQuery but unfortunately i'm not so knowledgeable of it. Please help me. Thanks guys.
Posted 25-Aug-12 10:28am
Comments
Zoltán Zörgő at 25-Aug-12 15:40pm
   
There are several Ajax accordion libraries out there. Please post at least the link, where you got yours.
TopThat.com at 25-Aug-12 15:41pm
   
what ajax accordion menu are you using? please post code
gaga blues at 25-Aug-12 15:47pm
   
asp:Accordion ID="Accordion1" CssClass="accordion" HeaderCssClass="accordionHeader" TransitionDuration="100"
FramesPerSecond="200" HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" runat="server"
FadeTransitions="true" RequireOpenedPane="false" Width="320px" AutoSize="None" >
<Panes>
<Header>
Acc1
</Header>

Hello!!

<Header>
Acc2
</Header>

Bye!!

</Panes>

 
I used Ajax Extender for the Accordion and the Accordion Pane.
gaga blues at 25-Aug-12 15:52pm
   
I dont know but the tag < Content > is not showing in my comment. But i enclosed both Hello!! and Bye!! with < Content > AND < / Content >
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
gaga blues at 26-Aug-12 22:42pm
   
Thanks! I'll go try this one out. :)
gaga blues at 3-Sep-12 22:38pm
   
I tried this but i'm a noob in using this code:
 
function pageLoad()
{
$find("accordionBehaviorID").add_selectedIndexChanged(
accordion_selectedIndexChanged);
}
 
function accordion_selectedIndexChanged(sender, args)
{
var oldIndex = args.get_oldIndex();
var newIndex = args.get_selectedIndex();
 
// Do something.
}
 
I put a line break then execute my C# website but the break wasnt triggered. Please tell me how to use the code above. Its a client-side selectedIndexChanged event
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Have you looked at this?
 
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Accordion/Accordion.aspx[^]
 
Essentially you should be able to see you selected index server side like this
 
Accordion1.SelectedIndex
  Permalink  
Comments
gaga blues at 26-Aug-12 22:45pm
   
Thanks! I'll go read and try this. THanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 25 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100