Accordion control for .net 3.5 sp1 is broken?

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?
 
A

Andy B

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
 
A

Andy B

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.
 
A

Andy B

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.
 
Joined
Jan 19, 2009
Messages
1
Reaction score
0
I agree with Andy, there seems to be a bug when using Accordion. I experienced similar issue when adding a dropdownlist in accordion and then adding items in the list via Items(collection) in properties window. When I first ran the webpage, it did not show me the dropdownlist in the pane and when I stopped the page, I went back to design mode and I saw the items were gone and an extender was added in the source code. I finally ended up adding list via <asp:listitem ..> tag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top