Accordion control for .net 3.5 sp1 is broken?

  • Thread starter Thread starter Andy B
  • Start date Start date
A

Andy B

I am trying to use an accordion control from the ajax control toolkit for
..net3.5 sp1. When I put a link in one of the accordion pannel
headerTemplates to open and close the content, I always get an "index of /"
page that shows the files and folders in the folder the current page is in.
The link looks like this: <a href="">Open/close test</a> Any idea why this
happens and how to fix it?
 
Can u post your accordion code? will be much clearer to figure out...
WebForm1.aspx accordion code:
<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<div>

<cc1:Accordion ID="Accordion1" runat="server" RequireOpenedPane="false"
SelectedIndex=0>

<HeaderTemplate>

<a href=""><%#Eval("Title")%></a>

</HeaderTemplate>

<ContentTemplate>

<%#Eval("Body")%>

</ContentTemplate>

</cc1:Accordion>

</div>



WebForm1.aspx.cs code for accordion:

Imports Test.eternityrecordsonlineEntities



Partial Public Class WebForm1

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

Dim NewsContext As New eternityrecordsonlineEntities()

Accordion1.DataSource = NewsContext.GetAllNews()

Accordion1.DataBind()

End Sub

End Class
 
Yea I know. I don't want this to load a new page, I just want it to
open/close the content of the pannel. The old versions of the control have
<a href="">blah</a> for opening/closing the pannel. What kind of URl would I
put in the href= section if the entire control is bound to a resultset from
a database? More direction would be helpful here.
 
This is now fixed. I had to do the following to get it to work:

1. In the HeaderTemplate, use a # for the url of the link. This is a code
telling the accordion control to open/close the pannels.
2. Set the SuppressHeadersPostback property to true. This stops the page
from reloading all the time.

There is still a bug in the control where setting some properties like
RequireOpenPane and SuppressHeaderPostback will create an accordion_extender
control and insert it into the accordion control source. This results in an
error 'The control Accordion1 doesn't have a public property
'accordion_extender''. Moving the accordion_extender control outside of the
accordion control results in a parse error: 'Only 1 control with the ID
'accordion_extender1' can exist on the page at a time...'. Totally deleting
the extender from the aspx source fixes the problems with the "extender
properties". I think this is a bug and should be fixed somehow.
 
Back
Top