什么系统条件可能会导致“control with id ‘xxx’”无法定位”?
昨晚,我们的一位用户发现了一个网站问题,据我所知,该网站已在 5 个月内没有进行过代码更改:
发生错误,因为无法使用 ID 为“xxx”的控件 位于或不同的控件被分配给相同的ID后 回发。如果未分配 ID,则显式设置 ID 属性 引发回发事件的控件以避免此错误。
我想知道什么情况会导致此错误发生,或者它是否一定是代码错误?例如内存不足、CPU 紧张等?
引用的 .ascx 文件明确分配了一个 id。
堆栈跟踪:
DotNetNuke.Services.Exceptions.PageLoadException:发生错误 发生的原因是具有 id 的控件 'dnn$ctr387$Dispatch$Default$rptToDos$ctl00$ctl00' 无法 位于或不同的控件被分配给相同的ID后 回发。如果未分配 ID,则显式设置 ID 属性 引发回发事件的控件以避免此错误。 ---> System.Web.HttpException:发生错误,因为带有以下内容的控件 id 'dnn$ctr387$Dispatch$Default$rptToDos$ctl00$ctl00' 无法 位于或不同的控件被分配给相同的ID后 回发。如果未分配 ID,则显式设置 ID 属性 引发回发事件的控件以避免此错误。在 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint、布尔值 includeStagesAfterAsyncPoint) --- 内部异常堆栈跟踪结束 ---
Last night one of our users identified an issue with a site that hasn't had coding changes I'm aware of in 5 months:
An error has occurred because a control with id 'xxx' could not be
located or a different control is assigned to the same ID after
postback. If the ID is not assigned, explicitly set the ID property of
controls that raise postback events to avoid this error.
I'm wondering what condition could cause this error to occur or if it has to be a code bug? For example low memory, strained CPU, etc.?
The .ascx file referenced does explicitly assign an id.
StackTrace:
DotNetNuke.Services.Exceptions.PageLoadException: An error has
occurred because a control with id
'dnn$ctr387$Dispatch$Default$rptToDos$ctl00$ctl00' could not be
located or a different control is assigned to the same ID after
postback. If the ID is not assigned, explicitly set the ID property of
controls that raise postback events to avoid this error. --->
System.Web.HttpException: An error has occurred because a control with
id 'dnn$ctr387$Dispatch$Default$rptToDos$ctl00$ctl00' could not be
located or a different control is assigned to the same ID after
postback. If the ID is not assigned, explicitly set the ID property of
controls that raise postback events to avoid this error. at
System.Web.UI.Page.ProcessPostData(NameValueCollection postData,
Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我对这个问题的解决方案;
为所有控件分配唯一的 ID 值,例如“Label”、“Button”、“Table”、“Div”等。
(但不包括“tr”和“td”)
My solution for this problem;
assigning unique ID value for all controls such as "Label","Button","Table", "Div" etc.
(But not include "tr" and "td")
嘿,戴夫,回收应用程序池可以解决这个问题吗?
我不确定它是什么,但我有时会遇到一些第 3 方 dnn 模块崩溃的情况。我记得的最后一个是一些 Ajax 旋转器。将应用程序池设置为按时间间隔回收是一个临时解决方案,但我最终换出了该模块。不确定里面发生了什么。
Hey Dave does recycling the app pool fix it?
I'm not sure what it is but I've had some 3rd party dnn modules crap out on occasion like this. Last one I recall was some Ajax rotator. Setting the app pool to recycle on a timed interval was a temporary fix but I eventually swapped the module out. Wasn't sure what was going on in it.
一定有什么事情发生了改变。更改可能不在该代码中,但某些地方发生了变化。它可以是任何内容,从 IIS 设置或 web.config 设置到升级或安装,但该服务器上的某些内容最近发生了变化。根据我的经验,代码不是恶意的,它不会感到不安并决定停止工作;)
我会验证 IIS 配置并检查 web.config,并查看事件日志以查看是否进行了任何维护最近服务器。
Something had to have changed. The change may not be in that code, but something changed somewhere. It could be anything from an IIS setting or web.config setting to and upgrade or install, but something on that server changed recently. In my experience code isn't spiteful, and it doesn't get upset and decide to stop working ;)
I would verify the IIS configuration and check the web.config, and look through the event logs to see if any maintenance was done on the server recently.