Click here to Skip to main content
12,504,984 members (66,084 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VS2008 C# ASP.NET Visual-Studio , +
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 9:28am
Comments
Zoltán Zörgő 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 25-Aug-12 15:41pm
   
what ajax accordion menu are you using? please post code
gaga blues 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>

<Header>
Acc2
</Header>

</Panes>


I used Ajax Extender for the Accordion and the Accordion Pane.
gaga blues 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 26-Aug-12 22:42pm
   
Thanks! I'll go try this one out. :)
gaga blues 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 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 25 Aug 2012
Copyright © CodeProject, 1999-2016
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