本文介绍了手风琴控制不在Visual Studio 2013中扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我在visual studio 2010中使用ajax手风琴控件设计了一个页面,它运行得很好。但是在visual studio 2013中使用相同的代码时,相应的加载数据,但只扩展了第一个标题。当你点击其他标题没有任何反应 - 它没有扩展该标题,它不会崩溃previousley扩展标题。在visual studio 2013中是否存在此控件的已知问题? Heres 我的代码 css文件(control.css) body {} 。 accordionHeader { color : 白色; 背景 : url(images / hd_bg.jpg)repeat-x; / * background-image:url(〜/ css / images / slide-img1.jpg); * / / * background-color:#255A8E; * / font : 粗体11px autoT rebuchet MS,Verdana; font-size : 12px; cursor : 指针; padding : 4px; margin-top : 0px; } 。 accordionContent { 背景 : url(images / cnt_bg.jpg) ; background-color : #E0E7FC; / * #EEE6E6 * / font : 普通11px auto Verdana,Arial; border : 1px gray; padding-left : 20px; padding-top : 7px; text-align : left; background-repeat : repeat-y; cursor : 指针; } 。 accordionHeaderSelected { color : white; background : url(images / sel_bg.jpg)repeat-x; font : 粗体11px autoTrebuchet MS,Verdana; font-size : 13px; cursor : 指针; padding : 4px; margin-top : 0px; } 。 labelErrorMode { color : 红色; } 。 labelSucessMode { color : 绿色; } a:link {颜色 : 栗色; } a:已访问 { 颜色 : 紫色; } a:hover { 颜色 : 红色; text-decoration : none; } a:有效 { 颜色 : #034af3; } 。 collapsePanel { background-color : white; 溢出 : 隐藏; } 。 collapsePanelHeader { background-image : url('images / bg-menu-main .png'); background-repeat : repeat-x; color : #FFF; font-weight : 粗体; } accordion.aspx文件 < %@ Page 标题 = 语言 = VB AutoEventWireup = false CodeFile = 〜/ Accordion.aspx.vb 继承 = Accordion %> <%@ 注册 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 = te xt / css / > < / head > ; < body > < 表格 id = form1 runat = server > < div > < asp:ScriptManager ID = ScriptManager1 runat = 服务器 > ; < / asp:ScriptManager > < asp:Accordion ID = AccordionCtrl runat = server CssClass = TransitionDuration = 20 HeaderCssClass = accordionHeader ContentCssClass = accordionContent 高度 = 244px 宽度 = 25 1px > < / asp:Accordion > < br / > < asp:Label ID = lblMsg runat = server 文字 = 标签 > < / asp:Label > < br / > < / div > < / form > < / body > < / html > accordion.aspx.vb file b $ b 进口Sy stem.Data.SqlClient Imports System.Data Imports GenUtil 进口AjaxControlToolkit 部分课堂手风琴 继承System.Web.UI.Page 受保护的子Page_Load(ByVal发送者为对象,ByVal e As System.EventArgs)处理Me.Load 如果不是IsPostBack然后 LoadSideMenu() 结束如果 End Sub Private Sub LoadSideMenu() 试试 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)。行 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 +& Dep artmentName =+ strDeptName newAccordionPane.ContentContainer.Controls.Add(hlink) 下一页 AccordionCtrl.Panes.Add(newAccordionPane) iPaneID = iPaneID + 1 下一页 Catch ex As Exception lblMsg.ForeColor = Drawing.Color.Red lblMsg.Text =发生错误:+ ex.Message 结束尝试 End Sub 私有函数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,myConnect离开) Dim ds作为新数据集 sdaFaculty.Fill(ds,tblFaculty) sdaDept .Fill(ds,tblDepartment) ds.Relations.Add(Children,ds.Tables(tblFaculty)。列(Portal_facultyID),ds.Tables(tblDepartment) ).Columns(FacultyID)) 返回ds 结束功能 结束类解决方案 我也遇到同样的问题...如果有人给出了确切的解决方案吗? 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? Heresmy code css file (control.css)body {}.accordionHeader { color: white; background: url(images/hd_bg.jpg) repeat-x; /*background-image:url(~/css/images/slide-img1.jpg);*/ /*background-color:#255A8E ;*/ 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; /*#EEE6E6*/ 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 fileImports System.Data.SqlClientImports System.DataImports GenUtilImports AjaxControlToolkitPartial 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 解决方案 Same problem occurs to me also...If any one give the exact solution to this? 这篇关于手风琴控制不在Visual Studio 2013中扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-30 08:56