当我通过 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)