I designed a page using the ajax accordion control in visual studio 2010 , and it was working perfectly. but on using the same code in visual studio 2013, the according loads data but only the first header is expanded. when u click on the other headers nothing happens-it doesnt expand that header and it doesnt collapse the previousley expanded header. Is there a known issue with this control in visual studio 2013?
Heres
my code
css file (control.css)
body {
}
.accordionHeader
{
color: white;
background: url(images/hd_bg.jpg) repeat-x;
font: bold 11px auto "Trebuchet MS", Verdana;
font-size: 12px;
cursor: pointer;
padding: 4px;
margin-top: 0px;
}
.accordionContent
{
background: url(images/cnt_bg.jpg) ;
background-color: #E0E7FC;
font: normal 11px auto Verdana, Arial;
border: 1px gray;
padding-left: 20px;
padding-top: 7px;
text-align: left;
background-repeat: repeat-y;
cursor:pointer;
}
.accordionHeaderSelected
{
color : white;
background: url(images/sel_bg.jpg) repeat-x;
font: bold 11px auto "Trebuchet MS", Verdana;
font-size: 13px;
cursor: pointer;
padding: 4px;
margin-top: 0px;
}
.labelErrorMode
{
color:Red;
}
.labelSucessMode
{ color:Green;}
a:link
{ color:Maroon;
}
a:visited
{
color: Purple;
}
a:hover
{
color: Red;
text-decoration: none;
}
a:active
{
color: #034af3;
}
.collapsePanel {
background-color:white;
overflow:hidden;
}
.collapsePanelHeader{
background-image: url('images/bg-menu-main.png');
background-repeat:repeat-x;
color:#FFF;
font-weight:bold;
}
accordion.aspx file
<%@ Page Title="" Language="VB" AutoEventWireup="false" CodeFile="~/Accordion.aspx.vb" Inherits="Accordion" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="controls.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Accordion ID="AccordionCtrl" runat="server" CssClass="" TransitionDuration="20" HeaderCssClass="accordionHeader" ContentCssClass="accordionContent" Height="244px" Width="251px">
</asp:Accordion>
<br />
<asp:Label ID="lblMsg" runat="server" Text="Label"></asp:Label>
<br />
</div>
</form>
</body>
</html>
accordion.aspx.vb file
Imports System.Data.SqlClient
Imports System.Data
Imports GenUtil
Imports AjaxControlToolkit
Partial Class Accordion
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
LoadSideMenu()
End If
End Sub
Private Sub LoadSideMenu()
Try
Dim ds As DataSet = GetDataSetForMenu()
lblMsg.Text = ""
Dim strDeptName As String
Dim strDeptID As String
Dim strFacultyName As String = ""
Dim strPrevDeptName As String = ""
Dim iPaneID As Integer = 1
For Each parentItem As DataRow In ds.Tables("tblFaculty").Rows
Dim newAccordionPane As New AccordionPane
Dim lblHeader As New Label
strFacultyName = parentItem("FacultyName").ToString
lblHeader.Text = strFacultyName
newAccordionPane.ID = "acc" + iPaneID.ToString
newAccordionPane.HeaderContainer.Controls.Add(lblHeader)
For Each childItem As DataRow In parentItem.GetChildRows("Children")
strDeptID = childItem("Portal_DepartmentID").ToString
strDeptName = childItem("DepartmentName").ToString
Dim hlink As New HyperLink
hlink.Text = strDeptName + "
" + "
"
hlink.NavigateUrl = "~/Department.aspx?DepartmentID=" + strDeptID + "&DepartmentName=" + strDeptName
newAccordionPane.ContentContainer.Controls.Add(hlink)
Next
AccordionCtrl.Panes.Add(newAccordionPane)
iPaneID = iPaneID + 1
Next
Catch ex As Exception
lblMsg.ForeColor = Drawing.Color.Red
lblMsg.Text = "Error occured: " + ex.Message
End Try
End Sub
Private Function GetDataSetForMenu() As DataSet
Dim conStr As String = UniversityCatalog.SQLConString
Dim myConnection As SqlConnection = New SqlConnection(conStr)
Dim sdaFaculty As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM tblFaculty", myConnection)
Dim sdaDept As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM tblDepartment", myConnection)
Dim ds As New DataSet
sdaFaculty.Fill(ds, "tblFaculty")
sdaDept.Fill(ds, "tblDepartment")
ds.Relations.Add("Children", ds.Tables("tblFaculty").Columns("Portal_facultyID"), ds.Tables("tblDepartment").Columns("FacultyID"))
Return ds
End Function
End Class