升级ASP .NET Ajax会产生_header错误。有人见过这个吗?

时间:2012-11-19 18:37:17

标签: asp.net .net-3.5 ajaxcontroltoolkit

当我通过NuGet将AjaxControlToolkit.dll升级到最新版本的工具包时,我的项目现在会产生一个错误,告诉我页面上有多个带有ID _header的控件。我不确定在客户端实际生成了什么,其id为_header,但我想我会先回复stackoverflow社区,然后再回滚并查看最后一个已知工作版代码的内容。

以下是错误的确切堆栈跟踪:

    EXCEPTION:Multiple controls with the same ID '_header' were found. FindControl requires that controls have unique IDs.
Data:System.Collections.ListDictionaryInternal
Stack Trace:   at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)
   at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)
   at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)
   at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)
   at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)
   at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)
   at System.Web.UI.Control.EnsureNamedControlsTable()
   at System.Web.UI.Control.FindControl(String id, Int32 pathOffset)
   at System.Web.UI.Control.FindControl(String id)
   at System.Web.UI.ControlUtil.FindTargetControl(String controlID, Control control, Boolean searchNamingContainers)
   at System.Web.UI.UpdatePanelControlTrigger.FindTargetControl(Boolean searchNamingContainers)
   at System.Web.UI.AsyncPostBackTrigger.Initialize()
   at System.Web.UI.UpdatePanelTriggerCollection.Initialize()
   at System.Web.UI.UpdatePanel.Initialize()
   at System.Web.UI.UpdatePanel.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

1 个答案:

答案 0 :(得分:2)

这就是答案的结果:当将ASP .NET Ajax版本更新到最新版本时,现在需要为Accordion Control中的每个Accordion Pane设置一个ID。如果您没有为它们分配ID,它会为您生成一个“_header”。在我的情况下,我有超过1个手风琴窗格,所以确实有超过1个相同的ID。我希望这有助于其他人。 Here是帮助我指明正确方向的帖子。 Big Ups CurtWRC:)