【问题标题】:Upgrading ASP .NET Ajax produces _header error. Anyone seen this before?升级 ASP .NET Ajax 会产生 _header 错误。有人见过这个吗?
【发布时间】:2012-11-19 18:37:17
【问题描述】:

当我通过 NuGet 将 AjaxControlToolkit.dll 升级到工具包的最新版本时,我的项目现在会产生一个错误,告诉我页面上有多个 ID 为 _header 的控件。我不确定在 _header 的 id 的客户端上实际生成了什么,但我想我会先询问 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)

【问题讨论】:

    标签: asp.net .net-3.5 ajaxcontroltoolkit


    【解决方案1】:

    所以这就是最终的答案:当将 ASP .NET Ajax 版本更新到最新版本时,现在需要为 Accordion Control 内的每个 Accordion Pane 拥有一个 ID。如果您不为它们分配 ID,它会为您生成一个“_header”。就我而言,我有不止 1 个 Accordion Pane,所以确实有不止 1 个具有相同的 ID。我希望这对其他人有帮助。 Here 是帮助我指出正确方向的帖子。大起大落 CurtWRC :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-23
      • 1970-01-01
      • 2017-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-31
      • 2017-01-05
      相关资源
      最近更新 更多