简体   繁体   中英

What system condition could cause “control with id 'xxx' could not be located”?

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 ---

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")

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM